
On 6/20/05, Eric Niebler <eric@boost-consulting.com> wrote:
The situation of interest is described in the ECMAScript specification (ECMA-262), section 15.10.2.15:
"Even if the pattern ignores case, the case of the two ends of a range is significant in determining which characters belong to the range. Thus, for example, the pattern /[E-F]/i matches only the letters E, F, e, and f, while the pattern /[E-f]/i matches all upper and lower-case ASCII letters as well as the symbols [, \, ], ^, _, and `."
A more interesting case is what should happen when doing a case-insentitive match on a range such as [Z-a]. It should match z, Z, a, A and the symbols [, \, ], ^, _, and `. This is not what happens with Boost.Regex (it throws an exception from the regex constructor).
Not meaning to be facetious, but why in heavens name would anyone want to use a character class like [E-f] or [Z-a]? Seriously, does anyone write regexps like this? -- Caleb Epstein caleb dot epstein at gmail dot com