Hi, I would like to know the regex options equalent to the following .Net Reqular Expressions Options: ** *Multiline* ** Specifies multiline mode. Changes the meaning of *^* and *$* so that they match at the beginning and end, respectively, of any line, not just the beginning and end of the whole string. *ExplicitCapture* ** Specifies that the only valid captures are explicitly named or numbered groups of the form (?<*name*>…). This allows parentheses to act as noncapturing groups without the syntactic clumsiness of (?:…). ** *Singleline* ** Specifies single-line mode. Changes the meaning of the period character (.) so that it matches every character (instead of every character except *\n*). *IgnorePatternWhitespace* ** Specifies that unescaped white space is excluded from the pattern and enables comments following a number sign (#). (For a list of escaped white-space characters, see Character Escapesms-help://MS.MSDNQTR.2005JUL.1033/cpgenref/html/cpconcharacterescapes.htm.) Note that white space is never eliminated from within a character class. Thanks in Advance. Regards Kiran
All of the following comments apply to the newly release Boost-1.33
*Multiline*
multiline is on by default. To turn it off either: 1) prefix your expression with (?-m) 2) compile your expression with the flag no_mod_m set: boost::regex r("^abc", boost::regex::perl | boost::regex::no_mod_m); 3) Pass the "match_single_line" flag to one of the matching/searching algorithms/iterators.
*ExplicitCapture*
Named captures aren't supported.
*Singleline*
This is on by default, you can turn it off by either: 1) Prefix your expression with (?-s) 2) Compile the expression with the flag no_mod_s set: boost::regex r("^abc", boost::regex::perl | boost::regex::no_mod_s); 3) Pass " match_not_dot_newline" flag to one of the matching/searching algorithms/iterators.
*IgnorePatternWhitespace*
Is this the same as Perl's x-modifier? If so then either: 1) Prefix your expression with (?x) 2) Compile your expression with the flag mod_x set: boost::regex r("^abc", boost::regex::perl | boost::regex::mod_x); John.
participants (2)
-
John Maddock
-
Kiran Reddy