Boost logo

Boost Users :

Subject: Re: [Boost-users] [xpressive] treating special literals as non-regex
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2011-10-13 12:42:03


On Thu, Oct 13, 2011 at 4:28 PM, Ovanes Markarian <om_boost_at_[hidden]>wrote:

> Hello *,
>
> I ran into a problem, that I use some regex to split a string by some
> delimiters. My interface to the outer world is non-regex. A user can pass
> anything like delimiter. E.g. $d$ can be a valid delimiter.
>
> If I use sregex_token_iterator with regex created as: as_xpr("$d$") are $
> treated as regex special characters and I have to escape them or can I
> safely use them in this context? If I have to escape the special characters
> is there any helper function like protect("$d$").
>
>
> Seems like I need to pass the match_type_flag as format_literal to the
sregex_token_iterator ctor. I found it a bit difficult to understand the
docs at
http://www.boost.org/doc/libs/1_47_0/doc/html/boost/xpressive/regex_token_iterator.html
since
parameters are sometimes not documented in the same order they appear in the
ctor signature.

With Kind Regards,
Ovanes



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