To find which characters fails, split it with /[A-Za-z\s.&]+/
, you will get invalid characters list
"test/string".split(/[A-Za-z\s.&]+/).join('')
/
To check username is valid or not, you could just use ^ and $ anchors.
/^[A-Za-z\s.&]+$/
S.Mark
2010-04-29 10:09:00