Re: Regex and variable usage
| From: | Gerard Samuel | Date: | Wed, 16 Jul 2003 20:34:27 +0000 |
| Subject: | Re: Regex and variable usage | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-155485@lists.php.net to get a copy of this message | ||
Curt Zirzow wrote:
Gerard Samuel <gsam@trini0.org> wrote:or even preg_match('/^[a-z0-9\-_\.]+\.[a-z0-9]{' . $foo . ', ' . $bar . '}$/', $some_string)that should work. Unfortunately it doesn't for some reason. Don't know why.
but you could do this: $pattern = "/^[a-z0-9\-_\.]+\.[a-z0-9]{$foo, $bar}\$/"; preg_match($pattern, $some_string) But this does, so Im good. Thanks for the tips...