Opened 7 years ago

Closed 7 years ago

#11524 closed Bugs (fixed)

regex [[:unicode:]] not matching the character u+100

Reported by: loli44fr@… Owned by: John Maddock
Milestone: To Be Determined Component: regex
Version: Boost 1.58.0 Severity: Problem
Keywords: Cc:

Description

The character u+100 is not found using the regex pattern[[:unicode:]].

Here sample :
#include <boost/regex.hpp>
#include <iostream>
using namespace std;
using namespace boost;

int main()
{
	wregex re(L"[[:unicode:]]");
	wstring wstr=L"\u0100";

	if(regex_match(wstr,re))
		cout<<"Match "<<endl;
	else
	{
		cout<<"Not match"<<endl;
	}
	return 0;
}


'Not match' is displayed.

Proposed fix :
--- boost_1_58_0\boost\regex\v4\regex_traits_defaults.hpp	Sat Feb 14 15:22:25 2015
+++ boost_1_58_0new\boost\regex\v4\regex_traits_defaults.hpp	Tue Aug 04 21:20:38 2015
@@ -51,7 +51,7 @@
 //
 template <class charT>
 inline bool is_extended(charT c)
-{ return c > 256; }
+{ return c > 255; }
 inline bool is_extended(char)
 { return false; }
 

Change History (2)

comment:1 by John Maddock, 7 years ago

Will investigate, thanks for the report.

comment:2 by John Maddock, 7 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.