I have the following code.
sregex rex = sregex::compile( "(\\w+) (\\w+)!" );
How I can get “(\w+) (\w+)!” out from rex?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.