Using regexp Version 1.2 on either Solaris 2.6 or WinNT 4 and versions 1.1.7 and 1.3 of Sun's JRE. Any pattern with a leading "\b" boundary has that boundary ignored. For example, If I make an RE object from the String "\\bfly\\b" (==> /\bfly\b/ ) that object will correctly fail to match the string "flying" but will incorrectly match the string "housefly"
If I understand the code correctly (big if), the following should fix this problem: change RE.java line 1050 from char cLast = ((idx == getParenStart(0)) ? '\n' : search.charAt(idx - 1)); to char cLast = ((idx == 0) ? '\n' : search.charAt(idx - 1));
This is not necessary for posix compliance but if the given fix works I will integrate it.
*** Bug 2371 has been marked as a duplicate of this bug. ***
ran into this problem personally. I integrated the fix into the src for 1.2 and the patch does work properly.
patch added. tests added and tested.
closed.