I'm a C++ and Boost newbie, and no regex guru, so don't quote me either :-) One thing I notice in your expression is a \t character following the =. Isn't that only going to match a tab? The boost::regex flag 'match_not_dot_newline' might be relevant, but since this flag must be explicitly set, it looks like dots match newlines by default. Would something as simple as this work (assuming dots match newlines)?: boost::regex ln0("WORD_TO_FIND=(.*)$", boost::regex::perl ); This assumes that the match you're looking for runs to the end of the string, which isn't clear. I'm also not clear if you want to match a single word or multiple words. Would stripping out newlines and replacing them with spaces first (or even later) help? Mick On Fri 12/03/10 10:32 AM , OvermindDL1 overminddl1@gmail.com sent:
I am newbie to boost::regex. I have a string including multiple new lines characters in it like the one> below.
"this is a big string\nthat I would
I tried the following regex but it doesn't match.> boost::regex ln0("WORD_TO_FIND=\t(?\\w+).+", boost::regex::perl );> Do you know what is the option and how to set it up> to enable the matching for an entire string and not line by line? Do not quote me, I am not that knowledgeable about regex, but give
On Thu, Mar 11, 2010 at 10:54 AM, Conoscenza Silente wrote:> Hi All like\ntoParse here:> WORD_TO_FIND=Ciao\nin the middle"> this a try, add a g\ to the beginning of your parsing line, or \g or \g\ or something like that, I think it means global... _______________________________________________ Boost-users mailing list B oost-users@lists.boost.orghttp://lists.boost.org/mailman/listinfo.cgi/boost-users