fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. /* Name of the class has to be "Main" only if the class is public. */
  6. class Ideone
  7. {
  8. public static void main (String[] args) throws java.lang.Exception
  9. {
  10. String s = "select *,length(devise) lendevise,length(marche) lenmarche,length(nature) lennature from tableX where nseq='0'";
  11. System.out.println(s.replaceAll("length\\(([a-zA-Z]+)\\)", "LEN($1)"));
  12. }
  13. }
Success #stdin #stdout 0.04s 2184192KB
stdin
Standard input is empty
stdout
select *,LEN(devise) lendevise,LEN(marche) lenmarche,LEN(nature) lennature from tableX where nseq='0'