[PHP] Re: regex for cleaning up username

2001-07-23 Thread maatt
> thinking it may be easier to parse for only allowed characters. *much* better idea. Try: preg_match('/[^\w]/', $string) to find all non-alphanumeric+underscore -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMA

[PHP] Re: regex for cleaning up username

2001-07-22 Thread CC Zona
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Dave) wrote: > Cannot seem to get a regex to check a string for the following > > space tab ' " ! @ # $ % ^ & * ( ) + = : ; / \ > > if(preg_match('[\'" ,!@#$%\^&*()+=:;/\\]',$mystring)) You need pattern delimiters with preg_* expression