Reputation: 181
I need a regex that will include all the alphabets, numbers and even all special characters except apostrophe(').
The below regular expression will work only for numbers and alphabets.
/^[a-z A-Z 0-9 ]*$/
But I need a regular expression which includes all the special characters except apostrophe (').
Upvotes: 1
Views: 9159
Reputation: 70075
The regular expression for "any character other than an apostrophe" would be: [^']
.
So a regular expression that will match a string as long as it does not have an apostrophe would be: /^[^']*$/
Upvotes: 6
Reputation: 172418
You can try to use this regex:
[^']
This Regex will match every character except apostrophe
Upvotes: 6