Re: Regex and variable usage

From: Date: Wed, 16 Jul 2003 20:50:52 +0000
Subject: Re: Regex and variable usage
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-155489@lists.php.net to get a copy of this message
Gerard Samuel a écrit:
Curt Zirzow wrote:
Gerard Samuel <gsam@trini0.org> wrote:
or even preg_match('/^[a-z0-9\-_\.]+\.[a-z0-9]{' . $foo . ', ' . $bar . '}$/', $some_string) I think, you Forgot, a \ before the $ at the end of the expression...
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...


« previous php.general (#155489) next »