Re: preg_match problem
| From: | Jim Lucas | Date: | Tue, 23 Jan 2007 19:19:37 +0000 |
| Subject: | Re: preg_match problem | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-247637@lists.php.net to get a copy of this message | ||
if (preg_match('/^[A-Za-z0-9!@#$%&()*;:_.'\\/\\\\ ]+$/', $string))Here is my rendition of what I think you are looking for. $str = 'tab( )/space( )/path-asdf\asdf_!@#$%^&*();:...'; if ( preg_match('|^[a-zA-Z0-9!@#$%^&*();:_.\\\\ /\t-]+$|', $str) ) { echo 'success'; } else { echo 'failure'; } -- Enjoy, Jim Lucas Different eyes see different things. Different hearts beat on different strings. But there are times for you and me when all such things agree. - Rush