K
kurt krueckeberg
Are Perl Compatible Regular Expressions (PCRE) supported with the regex support added to C++11?
I meant <regex> . Looks like various flavors of POSIX, according to
http://www.cplusplus.com/reference/regex/regex_constants/
If you want PCRE, it doesn't matter what is or isn't in C++11. Just link
with PCRE, and use it.
According to the answer given atare very similar to PCRE.
gcc's libstdc++ does not have regex implemented yet.
Jorgen said:It's common for people to prefer the standard library to some
third-party library which does the same thing, but in a non-standard
way.
Sure it does matter. There is a mountain of difference if you can just
rely on your code to working on all platforms with the standard C++
implementation, or you must take care of downloading, compiling,
integrating into the build process, porting and/or upgrading the library
when adding platforms or changing to a newer compiler version, etc, etc.
On the platforms that I care about, pcre comes as part of the standard OS
build.
And even on platforms that are not, if "downloading, compiling,
integrating, porting and/or upgrading" is such a big issue for
someone, they should probably find some other line of work,
other than C++ development. Really. I thought that "downloading,
compiling, integrating, porting and/or upgrading" is really what
a C++ developer is expected to do.
Paavo said:Not sure which part of above qualifies as "develop C++". For me, writing
my own code *on top* of existing libraries is much more fun than
downloading/upgrading/etc. The latter is just a necessary evil which I
would like to reduce to minimum.
The libraries exist even if they haven't been added to ISO/IEC 14882 by
a standards committee.
And if it really pains you to do simple and mundane things such as download
a package from the internet and install it, even if it only takes a couple
of mouse clicks or a simple command (sudo apt-get install libpcre3-dev),
then you have bigger problems to tackle other than what component has
or hasn't been standardized.
Öö Tiib said:What you are talking about? Linux? Linux crowd anyway uses C more
than C++.
What you are talking about? Linux? Linux crowd anyway uses C more
than C++.
No, that's an integrator's work. If you're a programmer in a large
organization, deciding "I need PCRE" creates an unknown amount of work
for different people down the line.
Someone has to watch out for
security bug fixes, someone has to do the paperwork related to
licensing and patent issues and whatnot. Someone has to make sure there
are people who can maintain the code if you're run over by a bus, and
so on ...
Thankfully, that's not the case everywhere. Thankfully, there are places
with blanket policies permitting usage of free software, and whose
development environments allow any developer to contribute and install a
particular free software package, making it available to the rest of the
organization.
I'm running Linux Mint with gcc version 4.7.2. While still
experimental, the <regex> header is present, and you can successfully
compile and link using regular expressions by suppling the
"-std=c++11" argument.
I don't know what you tried to say,
Well, not exactly true. The fact that Linux kernel is 100% C, does not
changes a fact, that many Linux applications are C++, too.
KDE and all KDE apps are C++ for example...
Yes, you can compile and link but code will not work...
references?
The web page I found at gcc.org which claimed "no support at all for
std::regex" was obviously wrong. And now that I bothered to check my
own system, I see that even libstdc++ 4.6 is shock full of regex
implementation.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.