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

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -