-
January 19th, 2015, 12:22 AM
#1
std::regex error_brack
Hi folks,
I have error_brack error when i execute the below code in Code::Blocks 13.12
Code:
try
{
std::string seq = "ollo hello wallo ";
std::regex rgx(" ([a-z]+) ", std::regex_constants::ECMAScript);
std::smatch m;
std::regex_match(seq, m, rgx);
std::cout << m.size() << std::endl;
for(size_t i=0; i<m.size(); ++i)
{
std::cout << i << std::endl;
std::cout << m[i] << std::endl;
}
}
catch (std::regex_error& e)
{
if (e.code() == std::regex_constants::error_badrepeat)
std::cerr << "Repeat was not preceded by a valid regular expression.\n";
if (e.code() == std::regex_constants::error_range)
std::cerr << "error_range.\n";
if (e.code() == std::regex_constants::error_collate)
std::cerr << "error_collate.\n";
if (e.code() == std::regex_constants::error_ctype)
std::cerr << "error_ctype.\n";
if (e.code() == std::regex_constants::error_escape)
std::cerr << "error_escape.\n";
if (e.code() == std::regex_constants::error_backref)
std::cerr << "error_backref.\n";
if (e.code() == std::regex_constants::error_brack)
std::cerr << "error_brack.\n";
if (e.code() == std::regex_constants::error_paren)
std::cerr << "error_paren.\n";
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|