I am trying to write a regular expression that doesn’t allow single or double quotes in a string (could be single line or multiline string). Based on my last question, I wrote like this ^(?:(?!"|').)*$, but it is not working. Really appreciate if anybody could help me out here.
I am trying to write a regular expression that doesn’t allow single or double
Share
Just use a character class that excludes quotes:
(Within the
[]character class specifier, the^prefix inverts the specification, so[^'"]means any character that isn’t a'or".)