[regex][bug]Regex::regex_search does not handle /B outside the word case correclty

Hello again. I found another issue of regex_search and created a patch for it, too. Please review it. Issue: regex_search() with "/B" is handling inside a word case correctly but not handing outside the word case correctly. i.e. regPat = /\B\u00c0/; regPat.exec("\u00C0\u00C0\u00C0"); //Should match but not Desc: In the ECMA262 spec(15.10.2.6), "\B" behavior is described as follows. 1. Let e be x's endIndex. 2. Call IsWordChar(e–1) and let a be the boolean result. 3. Call IsWordChar(e) and let b be the boolean result. 4. If a is true and b is false, return false. 5. If a is false and b is true, return false. 6. Return true. So it should match outside a word case not only inside case. (A word character list is [A-Za-z0-9_]). Patch: Patch for perl_matcher_common.hpp, attached. Modified match_within_word() to follow the spec. Regards. Hak Matsuda Lead Dev. CRI Middleware inc. 340 Brannan St #400, San Francisco, CA 94107
participants (1)
-
Hakuro