开发者

Getting Original Regular Expression Out From sregex (Boost Xpressive)

I have the following code.

srege开发者_开发百科x rex = sregex::compile( "(\\w+) (\\w+)!" );

How I can get "(\w+) (\w+)!" out from rex?


Looking at the documentation for basic_regex<> (sregex is just a typedef for basic_regex), I don't see any function that looks like it can retrieve the original textual representation of the regular expression.

If you really need that, you are going to have to create your own class that holds both a sregex and a std::string.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜