My question is simple.
Is there a PHP’s preg_match() function equivalent in the C++ STL?
If not, can you tell me an alternative?
Thanks.
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.
preg_match()calls code from libPCRE. If you want the equivalent ofpreg_match(), then you must use that library.Alternatively, if you just need the feature of regular expression matching (PCRE or not), there is also the
Boost::regexlibrary mentioned in another answer.If your compiler supports the new versions of the standard (C++11 or later), then it probably also includes the new standard regular expression library. The Standard includes support for ECMAScript syntax (which is very similar to, and based on, PCRE) as well as a few others.