I'm trying to figure out how to get my regular expression to accept certain special characters: ', , and - along with alphanumeric characters. I've had a stab at it but to no avail, and I'm quite new to regex, can anyone help?
Here was my attempt which, surprisingly, didn't work...
/^\d+/,\'\-\$/i
Something like this?
/[0-9a-zA-Z',-]+/
if it has to be a full string, you can use
/^[0-9a-zA-Z',-]+$/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With