开发者

Need help with boost regexp library

开发者 https://www.devze.com 2023-01-19 18:42 出处:网络
I\'m trying to port a code from PHP to C++. I was using the PHP build-in re开发者_StackOverflowgular expression to extract some value and it works well.

I'm trying to port a code from PHP to C++. I was using the PHP build-in re开发者_StackOverflowgular expression to extract some value and it works well. From some reason the same reg expression does not work when using the boot regexp library.

Could anyone spot what I'm doing wrong:

reg exp: regex exp("__EVENTVALIDATION" value="(.*)");

and the string is:

    <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBQL5gZjOBAL3+ML0DwL9ooevDwKMxOHvBwKJwsCnBEiKdYmQYZ6urlXsMG74R8hkXeMM" />

I need to extract the value.

Thanks


You probably need to escape the quotes for c++. Like so

regex exp("__EVENTVALIDATION\" value=\"(.*)");

0

精彩评论

暂无评论...
验证码 换一张
取 消