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 |
|
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.