|
Boost Users : |
From: mildaiv_at_[hidden]
Date: 2007-07-30 10:14:22
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
code I use:
boost::regex e("^[10+]*@$");
boost::match_results<std::string::const_iterator> what;
if(0 == boost::regex_match(input, what, e, boost::match_default | boost::match_partial)) // here function throw exception
{
throw std::runtime_error("Invalid data entered - this could not possibly be a valid card number");
}
if(what[0].matched)
{
return true;
}
return false;
Milan Bacik
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net