Issue
If you see java.lang.IndexOutOfBoundsException: No group 2 , when you are doing <String>.replaceFirst(<source string>, <target string>) or <String>.replaceAll(<source string>, <target string>).
Reason
You possibly have "$" character in your target string.
Solution
Add java.util.regex.Matcher.quoteReplacement(<target string>), before you apply replace function.
Bug reported on Sun site by someone.
Showing posts with label String. Show all posts
Showing posts with label String. Show all posts
Monday, October 09, 2006
Subscribe to:
Posts (Atom)