?
Solved

Regular expression to validate a firstname or a lastname

Posted on 2008-11-01
4
Medium Priority
?
971 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

765 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