Last active
December 20, 2015 17:49
-
-
Save minamiyama1994/6171027 to your computer and use it in GitHub Desktop.
boost::xpressive's bug?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include"boost/xpresaive/xpresaive.hpp" | |
namespace bx = boost::xpressive ; | |
auto main ( ) -> int | |
{ | |
bx::sregex regex1 = bx::bos >> ( "instance" | + ( bx::range ( 'a' , 'z' ) | bx::range ( 'A' , 'Z' ) ) ) ; | |
bx::smatch result ; | |
if ( bx::regex_search ( std::string { "instanceof" } , result , regex1 ) ) | |
{ | |
std::cout << result.str ( ) << std::endl ; // output : "instance" | |
} | |
bx::sregex regex2 = bx::bos >> ( + ( bx::range ( 'a' , 'z' ) | bx::range ( 'A' , 'Z' ) ) | "instance" ) ; | |
if ( bx::regex_search ( std::string { "instanceof" } , result , regex2 ) ) | |
{ | |
std::cout << result.str ( ) << std::endl ; // output : "instanceof" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment