If you're using Linux of MacOS, then
regex.h
should be installed as part of the libc development packages. Don't forget to
#include <sys/types>
before you
#include <regex.h>
. But I'm guessing you're using Windows and Visual Studio. In which case the bad news is that MS does not provide regex routines, but maybe you could move to C++ and use the C++ regular expression routines which are part of the C++ standard as of C++-11.
Regular expressions library - cppreference.com[
^]
If you are just starting out, then regex might not be a good fit for what you're trying to do. If all you want is some string handling the
str*()
functions may provide you with all you need (eg. str
chr(), str
spn(), str
str(), etc).
If you are intent on doing work with regex, and you are using Visual Studio, the you'll need to install a regex package. Doing a google search turned up this
Pcre for Windows[
^] Note that this is
Perl regular expressions, not POSIX. PCRE and Posix are similar, but not the same. If you're doing complex regular expressions, you may need to read some PCRE documentation:
PCRE - Perl Compatible Regular Expressions[
^]