C/C++中使用正则表达式
参考1:在C/C++语言中使用正则表达式
参考2:C++中的也能使用正则表达式
windows下使用gcc 4.9.2编译失败!错误提示如下。
根据参考1编写出来的regex.c,编译出来的提示是:regcomp、regexec、regeeror等几个函数undefined。
根据参考2编写出来的代码编译不通过,报错:'regex' is not a menber of 'std';
linux下测试:
参考1中的regex.c在ubuntu下编译通过且运行正常,输出数据如下:
String : 111 <title>Hello World</title> 222 Pattern: "<title>(.*)</title>" Total has subexpression: 1 OK, has matched ... begin: 4, len = 26 match: <title>Hello World</title> subexpression 1 begin: 11, len = 11 match: Hello World
参考2中的报错仍然是:‘regex’ is not amenber of 'std';
浙公网安备 33010602011771号