I want to use Javascript to validate user input for last name and first name by regular expression and just allow usa alphebetical letters plus space, apostroph and hyphen such as O'Neill and Lacova-D'elia.

How to write regular expression to validate user's input? Thanks a lot!
:rolleyes:

^[A-Za-z -']*$
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.