Previously, Zef Hemel said:
> $string = preg_replace("/[\\\*\+\-;]/s","",$string);
> 
> I think, you might have to escape the ; too

You don't need to escape * or + inside a character class since they don't
have a special meaning inside a character class.

You will need to use '\\\\' to match a backslash, however.  And if you move
the hypen to the last position in the character class, it loses its magic
property as a range specifier and no longer needs to be quoted either.

This should do what you want:

    $string = preg_replace("/[\\\\;*+-]/s", "", $string);

 -dan

-- 
The process for understanding customers primarily involves sitting around
with other marketing people and talking about what you would to if you were
dumb enough to be a customer.  -Scott Adams, "The Dilbert Principle"

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to