0

I'm validating an email form and for the name input I wanna make sure the user didn't enter in punctuation, or numbers in the field. Just letters a-z upper-cased, and lower-cased.

This doesn't seem to work:

/(?![\._])\p{P}|[0-9]/g
Matthew
  • 2,158
  • 7
  • 30
  • 52

2 Answers2

1

You can just use

/[a-zA-Z]/g

To match a valid name

Hope this helps

Mangiucugna
  • 1,732
  • 1
  • 14
  • 23
0

Why not just match on /[a-zA-Z]/g then?

kalley
  • 18,072
  • 2
  • 39
  • 36