Click here to Skip to main content
15,889,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi, I'm new in Regular expression and i would appreciate it if you can make a regular expression for a first name field.

- It should accept only accept 1 space bet two words (eg. Mary Joy)
- It should not contain any numbers
- ñ should also be accepted.


Thanks.
Posted

1 solution

Try:
^(([A-Za-zñ]+\s{1}[A-Za-zñ]+)|([A-Za-zñ]+))$
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900