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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^((Bob)|(John)|(Mary)).*$(?<!White)
Description
&quot;Starts with but does not end with.&quot; I needed a pattern to require certain first (and optional middle) names, but to fail for certain last names. So if Bob, John, and Mary are acceptable first names but the White's are always rejected then...
Matches
Bob Jones | John Smith | Mary Jane Smith
Non-Matches
Bob White | Mary Doe White | Gina Smith
Author Rating: Not yet rated. Eli Robillard
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: Fantastic! Thank you!
Name: HB
Date: 12/11/2008 2:44:20 PM
Comment:
Now I can stop pouring over and over the regex documentation and banging my head against the wall...


Title: Fantastic! Thank you!
Name: HB
Date: 12/9/2008 6:04:43 PM
Comment:
Now I can stop pouring over and over the regex documentation and banging my head against the wall...


Title: need
Name: rai`
Date: 7/18/2006 2:14:13 AM
Comment:
it is good for making a good array list of names


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