Using variables in regular expression ...
| From: | Ingo Theiss | Date: | Mon, 07 Aug 2000 11:02:38 +0000 |
| Subject: | Using variables in regular expression ... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-10446@lists.php.net to get a copy of this message | ||
Hi everyone,
I want to use variables inside a regular expression. Can anybody tell me the
correct syntax or is it impossible to use variables inside a regular
expression ?
Thanx for your help !
Ingo
PS: Here an example from my code ...
while(list($key, $value)= each($entitie_name)){
$line= ereg_replace("*$key*", chr($value), $line);
}
I have to get all expressions replaced matching $key, even if $key is inside
of an other word !