regular expression for letters, numbers and - _ .
- by Jorre
I'm having trouble checking in PHP if a value is is any of the following combinations
letters (upper or lowercase)
numbers (0-9)
underscore (_)
dash (-)
point (.)
no spaces! or other characters
a few examples:
OK: "screen123.css"
OK: "screen-new-file.css"
OK: "screen_new.js"
NOT OK: "screen new file.css"
I guess I need a regex for this, since I need to throw an error when a give string has other characters in it than the ones mentioned above.