I have a simple regex which throws: [java.lang.IllegalArgumentException] Illegal group reference.
The code is simple but I cannot figure out why. I have put
String Y in the second post to make it more readable (it contains some XML).
Exception in thread "main" java.lang.IllegalArgumentException: Illegal group reference
at java.util.regex.Matcher.appendReplacement(Matcher.java:561)
at java.util.regex.Matcher.replaceAll(Matcher.java:661)
at java.lang.String.replaceAll(String.java:1663)
at ReplaceTest.main(ReplaceTest.java:13)
[ March 24, 2005: Message edited by: Kashif Riaz ]