[thelist] Regular Expression help

Joshua Olson joshua at waetech.com
Mon Nov 17 08:48:12 CST 2003


----- Original Message ----- 
From: "Michael Robertson" <mike at mikeemedia.com>
Sent: Monday, November 17, 2003 9:27 AM


> i need a RE that will match a string that is a minimum of 6
> characters long and musit contain at least one digit.

Michael,

If by "character" you mean ANY character, then the following may work:

.{5,}[0-9]|....[0-9].|...[0-9]..|..[0-9]...|.[0-9]....|[0-9].{5,}

If by "character" you mean alphanumeric, then replace the periods with
whatever character set you want, eg:

[a-zA-Z0-0]{5,}[0-9]|    ...  etc

This a brute force technique, but should work nicely.

Good luck,

<><><><><><><><><><>
Joshua Olson
Web Application Engineer
WAE Tech Inc.
http://www.waetech.com
706.210.0168





More information about the thelist mailing list