We've expanded our news coverage and improved our search! Visit
oreilly.com for the latest or search for all things across O'Reilly!
| Hack: |
|
Avoid the dreaded replaceAll method
|
| Subject: |
|
Escape? |
| Date: |
|
2004-11-08 04:03:34 |
| From: |
|
eckes
|
|
|
|
I am not sure your sample is correct, in java:
a = "\"TEST\"";
for sure does not contain the escape char, because it is removed by the parser, this is not related to replaceAll. From javadoc:
An invocation of this method of the form str.replaceAll(regex, repl)
yields exactly the same result as the expression
Pattern.compile(regex).matcher(str).replaceAll(repl)
Greetings
Bernd
|