how do I match a dot character in boost.regex?

Jan 20, 2011 at 10:39am
since a dot in regex means any character, how do I match an actual dot and only that dot?
oh and for parenthesis too, since they denote subexpressions in boost.regex...
Last edited on Jan 20, 2011 at 10:58am
Jan 20, 2011 at 11:43am
Jan 20, 2011 at 2:34pm
In Boost Regex, "\\." matches the period or full stop character.

The suckiest part of regexes in C++ is that you have to escape the escape character. Thankfully that will be fixed in C++0x with raw string literals.
Jan 21, 2011 at 7:27am
Well in Java it is also the same. You have to escape the escape the character leading to very ugly looking regex.

Till this day, I still feel Perl regex is the best. It is the most legible, comprehensible form in comparison to other programming language regex.

In fact, PCRE was coined as the "standard" for regex. PCRE (Perl Compatible Regular Expression) seem to be the standard reference for any new programming language that intend to built a regex library into them.

This is good cuz once one is familiar with Perl regex, one can transfer those skills to other programming languages as long as their regex library is implemented based on PCRE.
Jan 21, 2011 at 11:39am
Yes... unfortunately PCRE has some significant limitations. Hence, the existence of other RE syntaxes.
Topic archived. No new replies allowed.