KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Does anyone know how to write a regexp that only allows a-zA-Z0-9.- (letters, numbers, dots, and dash) BUT that never starts or ends with a dot or dash ? I tried this one : /^[^.-][a-zA-Z0-9.-]+[^.-]$/ ... but if I write something like "john@", it works, and I don't want to because @ is not allowed.
Tags (comma-separated)
Save Edits
Cancel