I have the following string:
<? repeat min=1 max=2 ?>[A-Z0-9]{6},< ? endrepeat ?>100,USD,Washington
No space between < and ? in actual string
I am using the following code:
boost::regex repeatRegex("<\? repeat min=[0-9]+ max=[0-9]+ \?>(.*)<\? endrepeat \?>");
std::string theString = "<? repeat min=1 max=2 ?>[A-Z0-9]{6},<? endrepeat ?>100,USD,Washington";
boost::sregex_token_iterator itr(repeatDefinition.begin(), repeatDefinition.end(), repeatRegex);
boost::sregex_token_iterator end;
std::cout << std::endl << repeatDefinition << std::endl;
for(; itr != end; ++itr)
{
std::cout << *itr << std::endl;
}
The code never enters the for loop. I have tested the regex with the input string in rubular regex and it apparently works. Any pointers will be greatly appreciated.