I have a list of expressions that I would like to validate, and extract specific parts of.
These expressions are allowed to have any combination of:
Valid expressions would start after a colon, and end with a semi-colon.
An example of a valid expression would be:
: This is an *expression* 'with' and 'without \'escaped\' string literals',
which ends with a semicolon!;
And out of that expression, I would like to extract:
This is an *expression*
'with'
and
'without \'escaped\' string literals'
, which ends with a semicolon!
Is this possible?
Spoke to RectangleEquals, the answer is std::regex re_("'(?:\\.|[^'])*'|[^']+");