Solved

Regular expression to validate a firstname or a lastname

Posted on 2008-11-01
4
966 Views
Last Modified: 2012-05-05
i need to fix the validation express to work for a last name.

ValidationExpression="^[a-zA-Z]{2,}\s[a-zA-Z]{3,}$" ErrorMessage="<b>A valid Last Name name is required,</b><br />


0
Comment
Question by:mathieu_cupryk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 16

Expert Comment

by:Gyanendra Singh
ID: 22860333
use this
"^[A-Z]+[a-zA-Z]*$"
0
 

Author Comment

by:mathieu_cupryk
ID: 22860381
the user should at least enter 2 characters
0
 
LVL 60

Accepted Solution

by:
Kevin Cross earned 500 total points
ID: 22860395
Try this:

"^[A-Z]{1}[a-zA-Z]{1,}$"

0
 
LVL 16

Expert Comment

by:Gyanendra Singh
ID: 22860672
try this


^[a-zA-Z'.\s]{2,8}$"

{2,8} length would be 2 to 8
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question