Boost logo

Boost Users :

Subject: Re: [Boost-users] Escaping boost.regex literal string fragments
From: Dominique Devienne (ddevienne_at_[hidden])
Date: 2015-10-13 14:03:59


On Tue, Oct 13, 2015 at 6:38 PM, Dominique Devienne <ddevienne_at_[hidden]>
wrote:

> On Tue, Oct 13, 2015 at 6:10 PM, John Maddock <jz.maddock_at_[hidden]>
> wrote:
>
>> On 13/10/2015 14:20, Dominique Devienne wrote:
>>
>>> Is there no equivalent to http://doc.qt.io/qt-4.8/qregexp.html#escape
>>> in Boost.Regex, i.e. a way to escape all special characters so they match
>>> "literally"?
>>>
>>> No, can you use Perl's \Q \E construct for the same effect?
>
>
> Sounds like I could indeed. Didn't know about them. Thanks John!
>

Works great. Thanks again. --DD

> I'll try \Q \E using std::regex too.
>

Apparently there's no Perl syntax in std::regex. So I used boost::regex
instead. I'd have prefer std:: though. --DD



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