[thelist] Regular Expression

David Gray david_gray at 3b2.com
Thu Mar 7 08:49:00 CST 2002


> I am programming in an ASP environment and want to use a
> regular expression to find out if a string is the only thing
> in another string.  Can anyone help me?
>
> Specifically, if I had the string "CATS,DOGS,RATS"  I would
> like to test if the string only says "CATS."

/^CATS$/

^ anchors your pattern to the beginning of the string, and $ anchors it
to the end of the string.

<http://www.4guysfromrolla.com/webtech/090199-1.shtml>

HTH,

 -dave





More information about the thelist mailing list