newbie: regular expression suggestios
| From: | Lee P Reilly | Date: | Thu, 31 Jan 2002 19:44:56 +0000 |
| Subject: | newbie: regular expression suggestios | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-82976@lists.php.net to get a copy of this message | ||
Hi,
I am using (getting to grips with) regular expressions for validating
form data and have come across a little problem:
I have a statement like the following:
if (eregi("^[a-z0-9]{strlen($name)}$, $name))
{
blah...
return true;
}
, but the strlen($name) does not seem to evaluated. Is there any way
this can be accomplished? If the code above is not clear (or correct!),
I am returning true iff the input is comprised of chars
(letters/numbers) only. Maybe there's a better/more efficient way to
accomplish this..?
Any information greatly aprpeciated. Thanks in advance!
- Best regards,
Lee Reilly
--
Lee P. Reilly, ms:G758
Szilard Resource, tel:505-665-7025
Bioscience Division,
SM-30 Bikini Atoll Rd,
Los Alamos National Laboratory, mailto:lreilly@lanl.gov
Los Alamos, NM 87545. http://home.lanl.gov/lreilly
"Quidquid latine dictum sit, altum viditur"