I need help from someone more experienced please to quickly point out the most concise or elegant way (perhaps regex?) to validate a field based on its character types. I want to validate that my field contains only letters (A to Z), digits (0 through 9), and only the character "-" (a hyphen).
If the field contains any other punctuation (eg underscore, period, comma) I want it to fail the test.
So I'm looking for a filter or regex tool to do the above, and I think someone will know better than me! Thanks