Looking for an easier regex check...

From: Date: Mon, 29 Apr 2002 20:10:11 +0000
Subject: Looking for an easier regex check...
Groups: php.general 
Request: Send a blank email to php-general+get-95238@lists.php.net to get a copy of this message
Does anybody know of a good way to make sure that a string contains ONLY certain characters. I tried using ereg("[~`!@#$%^&*(){}-+=|\\/.,<>'\":;\[\]]", $string); but I get parse errors. Besides that I only want the characters A-Za-z0-9_ in $string. Is there is simpler way to ensure this rather than checking to see if any of the characters I don't want are in there? Thank you for your help in advance. -- Joshua E Minnie/CIO josh@acsurf.net Phone: 616.276.9690 Fax: 616.342.8750 Nextel: 616.862.2847 "Don't work for recognition, but always do work worthy of recognition."

« previous php.general (#95238) next »