All posts tagged with 'IllegalArgumentException'

Javas String.replaceAll

21-Jul-09

The following statement "foo baz".replaceAll("baz","$bar");"foo baz".replaceAll("baz","$bar"); will present you an java.lang.IllegalArgumentException: Illegal group reference exception as the replacement string can contain backreferences to the search pattern as stated in Mather#replaceAll: This method first resets this matcher. It then scans the input sequence looking for matches of the pattern. Characters that are not part of any […]

Read the complete article »