I’m looking for something will accept names, salutations, and numbers. Things like Mr., O’Henry, and Bobby-Lee should also be accepted. So besides a period, an apostrophe, a hyphen, letters, and numbers, nothing should work. Not even whitespace. Help is much appreciated!
I’m looking for something will accept names, salutations, and numbers. Things like Mr., O’Henry,
Share
Not even whitespace? I know people whose first name has two parts spelled with a space rather than a hyphen (English versions of Vietnamese and Chinese names).
http://regular-expressions.info/tutorial.html and
https://developer.mozilla.org/en/JavaScript/Guide/Regular_Expressions will tell you all you need to know to do something simple like this, but anyway:
A regular expression with
[^...]will match any character other than the ones following the^.\dis for numeric digit.