How does std::regex work?

Jul 13, 2014 at 5:55pm
Good Evening!
I'm writing some kind of parser and the c++11 regex library might come in handy. Now the most recent g++ compiler in my package sources doesn't support it yet (g++ Debian 4.7.2-5) so I considered getting myself a newer one...

In std::regex:

Will the expression string be interpreted in run- or compile time?
In the latter case: Am I able to compile my application for a libc++ that predates the full regex support in gcc provided that the expressions are constant?

I'm aware of other regex libraries like boost regex but I don't want to generate any new runtime depedencies...

Edit: And to be honest I don't like the idea of having my regular expression interpreted like all the time so statically linking some regex library doesn't seem like a good solution.

hithere
Last edited on Jul 13, 2014 at 6:10pm
Jul 14, 2014 at 3:05am
Will the expression string be interpreted in run- or compile time?

run-time: it throws exceptions when failing to parse. For compile-time regex, look at boost.xpressive.

Jul 14, 2014 at 12:51pm
Thanks, Exactly what I was looking for, I like it. Only knew boost::regex so far.
Topic archived. No new replies allowed.