How do you use boost::regex_search
with the ignore case flags or constants in C++?
Please post an easy example.
Thanks!
By default, the comparison of an input string with any literal characters in a regular expression pattern is case-sensitive, white space in a regular expression pattern is interpreted as literal white-space characters, and capturing groups in a regular expression are named implicitly as well as explicitly.
You need something like this
boost::regex regex("your expression here", boost::regex::icase);
boost::smatch what;
string mystring;
bool search_result = boost::regex_search(mystring.begin(),mystring.end(), what, regex);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With