RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^([a-zA-z\s]{2,})$
Description
This pattern matches is for validating Names, Cities, States, Countries etc that require only alphabet inputs with white spaces. It requires atleast 2 characters & there's no limit on maximum number of characters.
Matches
Amit Gupta | Some Body
Non-Matches
A | Someplace23 | New-Jersey
Author Rating: Not yet rated. Amit Gupta
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: It works
Name: Amit upta
Date: 12/29/2004 10:47:53 AM
Comment:
It works & its used in my PHP application which works as well. You'll have to use eregi() in PHP to use this RegEx. Its not a Perl compatible RegEx so using preg_match() won't work. Besides, you can use this website's testing engine to test this RegEx.


Title: I meant to say
Name: L33t H4x0r
Date: 12/28/2004 10:57:43 PM
Comment:
I meant to say that TX and NM and other SINGLE words work, but New York, New Jersey and other two or more words, seperated by spaces, do not work for me.


Title: Broken
Name: L33t H4x0r
Date: 12/28/2004 10:55:24 PM
Comment:
It doesn't work for me using PHP4. TX, NM but even Amit Gupta doesn't work.


Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials