[thelist] ASP - Regular Expressions

Joshua Olson joshua at waetech.com
Tue Aug 5 12:06:48 CDT 2003


If you *require* that the first and last characters are alphas, then you
MUST use + instead of *, because * matches 0 instances as well.

In plain English (not examples) what is the rule you are trying to build?
Sometimes trying to write what you are trying to accommodate is more
effective than showing a couple examples and may even lead you to your own

Here are two questions to get you thinking:

1.  Is the hyphen required to be in the string.
2.  Must there be at least one character on either side of the hyphen?

Joshua Olson
Web Application Engineer
WAE Tech Inc.

----- Original Message ----- 
From: <burgan at iprimus.com.au>
Sent: Tuesday, August 05, 2003 10:13 AM

----- REPLY -----
"[\-{2}]" should match --
Will that do for you?
----- /REPLY -----

Nah nothing's working.

By the way i'm trying to make entries like "--text" and "text--" return
false.. but i'm also trying to make "-text" and "text-" return FALSE.

Code like "t-ext" or "te-xt" etc is what I want to return TRUE.

More information about the thelist mailing list