Opened 14 years ago

Closed 14 years ago

#2055 closed Bugs (invalid)

\u20ac (euro sign) not parsed correctly

Reported by: anonymous Owned by: John Maddock
Milestone: Boost 1.36.0 Component: regex
Version: Boost 1.34.1 Severity: Problem
Keywords: Cc:

Description

boost::RegEx r;
r.SetExpression("^([\\u20ac])");
r.Search("c"); // Yields true!

r.SetExpression("^(\\u20ac)");
r.Search("c"); // Yields false!

I believe both should return false!

Change History (1)

comment:1 by John Maddock, 14 years ago

Resolution: invalid
Status: newclosed

Boost.Regex doesn't recognise \u as a Unicode escape sequence: for historical reasons \u has another meaning.

Use \x{20ac} to match a euro sign, see docs here: http://www.boost.org/doc/libs/1_35_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html

HTH, John Maddock

Note: See TracTickets for help on using tickets.