mousemat24
asked on
How to use regex for names
Hi I have this regex
Regex re = new Regex(@"^[a-zA-Z]+$");
for firstname or lastname
the issue I have is it will not except
'
-
Can someone please change the regex so that it works with what I have already
thanks
Regex re = new Regex(@"^[a-zA-Z]+$");
for firstname or lastname
the issue I have is it will not except
'
-
Can someone please change the regex so that it works with what I have already
thanks
ASKER
I have this code
Regex re = new Regex(@"^[a-zA-Z]+$");
re.IsMatch(lastName))
Regex re = new Regex(@"^[a-zA-Z]+$");
re.IsMatch(lastName))
ASKER
I also want
min char 5
max chars 20
using regex
min char 5
max chars 20
using regex
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Regular expressions are sometimes overkill. You may be able to achieve the same result with some easier-to-understand string manipulations.