【发布时间】:2012-11-10 01:30:32
【问题描述】:
我正在寻找 C++11 中的正则表达式,它可以匹配字符串中的子字符串。
类似:"It´s a dark night out there...",我正在搜索 ark
因此,如果子字符串在字符串中的某个位置,则此表达式应匹配。 此外,我想选择说这个匹配是否区分大小写。
我已经尝试过了,但它似乎不起作用......
string str = "It´s a dark night out there...";
regex ex ("ark");
if (regex_match (str,ex))
cout << "Match found!";
有人知道类似的吗?
【问题讨论】:
标签: c++ regex string c++11 substring