-
I need to use std::regex and validate the input strings in C++
Input strings should be betweenfolder-1orfolder-01orfolder-001tofolder-200(Prefix must be ‘folder-‘)
How to write a regular expression for this? -
Is the regular expressions uses in C++ different from regular expressions use in other languages such as PHP and JavaScript?
-
Do most C++ developers use ‘Boost regx’ or ‘std::regex’ (some comments please)?
I need to use std::regex and validate the input strings in C++ Input strings
Share
Something like
example:
http://liveworkspace.org/code/1EfD0Q$12
You can read about std::regex in C++ standard, or about boost::regex in boost docs.
boost::regex is stable library and std::regex is new feature of C++11 standard.
Now, for example gcc 4.7 cannot handle this regex, so, use boost is better (in sample on LWS I use boost::regex instead of std::regex, since std::regex in gcc 4.7 cannot handle correctly {n, m}).