From: <[EMAIL PROTECTED]> > 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?
Maybe... $term = preg_replace('/[^\\]./','x',$term); which would replace any character that's NOT a \ followed by any other character with an x... Not tested, of course. :) ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php