A
a_c_Attlee
// java has claimed to have added Perl style regular expressions ,
however
// writing a regular expression containing a variable is ugly in java.
// in Perl: $rec =~ s/$delimiter//g is easy to write and to read.
// in java: if delimiter may hold say "||" or "!" isntead of [a-z]
text,
// you have to quote it as below with preceding \\Q (not just \Q ) and
// trailing \\E. ugly and difficult to code!
rec = rec.replaceAll("\\Q" + delimiter + "\\E" ,"");
So even though java has perl style regex in principle, in practice,
in java they seem nearly unusable!
-A.C. Attlee
however
// writing a regular expression containing a variable is ugly in java.
// in Perl: $rec =~ s/$delimiter//g is easy to write and to read.
// in java: if delimiter may hold say "||" or "!" isntead of [a-z]
text,
// you have to quote it as below with preceding \\Q (not just \Q ) and
// trailing \\E. ugly and difficult to code!
rec = rec.replaceAll("\\Q" + delimiter + "\\E" ,"");
So even though java has perl style regex in principle, in practice,
in java they seem nearly unusable!
-A.C. Attlee