(another) regex difficulty
| From: | jonas_weber @ gmx . ch | Date: | Wed, 01 Oct 2003 15:21:00 +0000 |
| Subject: | (another) regex difficulty | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-164560@lists.php.net to get a copy of this message | ||
regular expressions
the example below should turn any character exept "\*" (*= any char) into an "x":
$term = preg_replace('/[^(\\\)+(.){1}]/', 'x', $term);
but i guess because of the [brackets] the "." (period) is treated as character "." instead as metacharacter (that matches any char).
anyone knows how to work around this?
thanks for your effort
best wishes,
jns
ps: thanks for your help, holmes and kilimajer!