First of all, I hope you are aware of the fact that you mixed repeatDefinition
and theString
as identifiers?
Secondly, you need to escape \
in c++ string literals:
boost::regex repeatRegex("<\\? repeat min=[0-9]+ max=[0-9]+ \\?>(.*)<\\? endrepeat \\?>");
See it Live On Coliru
Also may I draw your attention to this answer: