[xpressive] Does '_' match newlines?

I have the following static regex: sregex filename_re = icase("Content-Disposition:") >> -*_ >> "filename=" >> (s2=-+_) >> ';' ; I want the "*_" part to also match newline characters. I didn't see any flag to turn this on or off. Is this on by default? I see boost::xpressive::regex_constants::syntax_option_type::not_dot_newline, but not sure where you would (or wouldn't) specify this. I only recall the ability to specify flags for a regex when you compile a dynamic regex, not a static one. Help is appreciated! --------- Robert Dailey

On 3/19/2012 3:21 PM, Robert Dailey wrote:
I have the following static regex:
sregex filename_re = icase("Content-Disposition:") >> -*_ >> "filename=" >> (s2=-+_) >> ';' ;
I want the "*_" part to also match newline characters. I didn't see any flag to turn this on or off. Is this on by default?
It always matches exactly one character, including newlines. If you want to match one character that is not a newline ('\n'), use ~_n. To match any one character that is not a logical new line ('\r', '\n', "\r\n", others), use ~_ln. HTH, -- Eric Niebler BoostPro Computing http://www.boostpro.com
participants (2)
-
Eric Niebler
-
Robert Dailey