Re: regexps
| From: | CC Zona | Date: | Wed, 08 Aug 2001 21:20:27 +0000 |
| Subject: | Re: regexps | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-61912@lists.php.net to get a copy of this message | ||
In article <KFEKLFMNHDILCMFAEKJCAEFIDAAA.scott@graphictype.com>,
scott@graphictype.com (Scott) wrote:
> here are two regexps that might do what you want
>
> "\w" matches alphanum (1-9a-zA-z)
(0-9a-zA-Z_) actually. Don't forget that zero and underscore!
> IMO, the best way to check for non-alphanum chars is
> to check for "\W" (upper case is negation of alphanum,
> which will match only non-alphanum).
Yep, works nicely as long as including the underscore as one of the
alphanumeric character is acceptable for your purposes.
--
CC