Boost logo

Boost Users :

Subject: Re: [Boost-users] [regex] function to escape regex control characterslike QRegExp::escape?
From: John Maddock (boost.regex_at_[hidden])
Date: 2010-05-19 12:06:43


> Is there a function to escape regex control characters like RegExp::escape
> already in boost::regex or perhaps boost::expressive?

No.... it depends upon the regular expression syntax as well, should be
trivial to make a list of special characters and do a search and replace?
Oh, and don't forget you can wrap the "literal" part of the expression in \Q
... \E which has the same effect.

HTH, John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net