Re: (another) regex difficulty

From: Date: Wed, 01 Oct 2003 17:07:37 +0000
Subject: Re: (another) regex difficulty
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-164585@lists.php.net to get a copy of this message
01.10.03 at 18:17 Curt Zirzow wrote:
preg_replace('/(?<!\\).{1}/', 'x', $term);
01.10.03 at 18:27 CPT John W. Holmes wrote:
$term = preg_replace('/[^\\]./','x',$term);
they don't work (thanks anyway) it's pretty simple: i need a regex that matches any character in a string except "\*" (* stands for any char that follows the "\"). example: "this is \ba test" should match: this a is test isn't there a way to do this? best wishes, jns

« previous php.general (#164585) next »