From: Hakuro (hakuroum_at_[hidden])
Date: 2007-11-14 19:32:51
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.
regPat = /\B\u00c0/;
regPat.exec("\u00C0\u00C0\u00C0"); //Should match but not
In the ECMA262 spec(220.127.116.11), "\B" behavior is described as follows.
1. Let e be x's endIndex.
2. Call IsWordChar(e1) 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.
CRI Middleware inc.
340 Brannan St #400, San Francisco, CA 94107
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk