Ralph Bergmann wrote:
I want to replace parts of a string but get an error :-(
The code:
String reSiezedURL = foo;
reSiezedURL = reSiezedURL.replaceAll((?w=[0-9]+),
reSiezed?
String.format(?w=%d, this.reqWidth));
reSiezedURL = reSiezedURL.replaceAll((w=[0-9]+),
Am 07.04.13 09:34, schrieb Lew:
Ralph Bergmann wrote:
Caused by: java.util.regex.PatternSyntaxException: Invalid value for
match mode flags near index 4:
(?w=[0-9]+)
^
I found it, the problem is the ? at the beginning. It is also a regex
metacharacter.
([?]w=[0-9]+) works
2 matches
Mail list logo