Duplicate of: There is a function to use pattern matching (using regular expressions) in C++?
I'm not sure where one would use it... are there any parser-type functions that take some regex as an argument or something? I just found out that my editor will highlight a line after / as "regex" for C/C++ syntax which I thought was weird...
In the vanilla C++ language there is no support for regular expressions. However there are several libraries available that support Regex's. Boost is a popular one.
Check out Boost's Regex implementation.
PCRE is the de-facto standard regex library for C (and it also works in C++).
(What your editor is doing I don't know. Using a library like PCRE or any of the others suggested doesn't change the syntax of C - your regex definitions will always be held in strings.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With