Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2007-01-15 05:31:59


éÇÏÒØ íÉËÕÛËÉÎ wrote:
>> Hello!
>>
>> I wrote the regular expression:
>> ^\s*(?:([A-Za-z_]*)\s*=\s*([A-Za-z0-9_/\.]*)\s*)*$
>>
>> for splitting lines like:
>> name = abc value1 = def value2 = ghi
>>
>> I need the result like:
>> match [1] = name
>> match [2] = abc
>> ...
>> match [6] = ghi
>>
>> But I get ! :
>> match [1] = value2
>> match [2] = ghi
>> (the last 2 matches)
>>
>> What is wrong in my expression?

This is normal regular expression behaviour, please see
http://www.boost.org/libs/regex/doc/captures.html for an explanation, and
possible solution.

John.


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