c++ - boost regex without possessive quantifiers -
is there similar way write regex without using possessive quantifiers (ie ++ , *+ ?
boost::regex testing123("\"value\":\"((?:[^\\\"\\\\]++|\\\\.)*+)\""); i think comparable(?):
boost::regex testing123("\"value\":\"(?>(?:(?>[^\\\"\\\\]+)|\\\\.)*)\""); update: it's trying match quoted text--but inside double quotes, there can number of inner, escaped quotes.
possessive quantifiers syntactic sugar atomic grouping, i.e. (ab)*+ equivalent (?>(ab)*). using this, can rewrite whole expression without using possessive quantifiers.
Comments
Post a Comment