R
Rusty Phillips
I know about negative lookahead and negative character closures,
but I can't find any good way to do actual negation.
One thing I'd like to use this for is to match quotes while
guaranteeing that I'm not matching backslashed quotes (that is, if I
find a backslash in the string, the quote in front of it should not
be matched).
This string:
String = q{She said,
Welcome to the party\\""}
Should match
He said, \\"Welcome to the party\\"
as the part within the quotes, and not
He said, \\
There are many more places where I'd like to use a negation
technique - especially I'd like to match things of the form:
"match the largest string that doesn't contain the character sequence
'blah.'"
Are there any ways to do either of these types of negation?
but I can't find any good way to do actual negation.
One thing I'd like to use this for is to match quotes while
guaranteeing that I'm not matching backslashed quotes (that is, if I
find a backslash in the string, the quote in front of it should not
be matched).
This string:
String = q{She said,
Welcome to the party\\""}
Should match
He said, \\"Welcome to the party\\"
as the part within the quotes, and not
He said, \\
There are many more places where I'd like to use a negation
technique - especially I'd like to match things of the form:
"match the largest string that doesn't contain the character sequence
'blah.'"
Are there any ways to do either of these types of negation?