Re: [Boost-users] boost::regex_match throws exception
mildaiv@centrum.cz wrote:
I build boost::regex 1.34 using Borland BDS 2006. Simple regular expresions works fine, but I have problem with this regular expresion: ^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$ if a try to match it with any string longer then 22 bytes, regex throws exception. After some investigations i simplified regular expresion to ^[10+]*@$ and it still throws exception
I can't reproduce with Boost-1.34: please post a complete self contained test case. Also make sure that those \'s are double escaped if they're embedded in code:
boost::regex e("^[_a-zA-Z0-9-]+(\\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)+$");
This was the problem, everything now works fine. Thanks for your help.
Otherwise the expression does something rather different, and *will* get pathological and throw an exception.
HTH, John.
participants (1)
-
mildaiv@centrum.cz