Skip character in range

I have a regex: /["-,]/

Which matches a character in the range from :

to ,

I want to skip the match for '

(apostrophe). Any help!



returns true for a string with an apostrophe. I need to reverse this line that has an apostrophe


source to share

1 answer

You can use negative lookahead:



Here (?!')

is a negative lookahead, which means that the next character must not be a single quote.



All Articles