RE re = new RE("fo(o)"); String foo = re.subst("foo", "$1", RE.REPLACE_BACKREFERENCES); This code throws IndexOutOfBoundsException. I have included a patch that fixes the issue and adds a test case to watch for this.
Created attachment 15990 [details] Patch to fix the described bug.
Fixed (long time ago). Please always test against source repository first. *** This bug has been marked as a duplicate of 22928 ***