Re: regex

From: Date: Fri, 29 Sep 2000 08:01:16 +0000
Subject: Re: regex
Groups: php.general 
Request: Send a blank email to php-general+get-18015@lists.php.net to get a copy of this message
What I'm trying to do is check form input for non-alphanumeric characters such as % * $ < > ! and all the rest that could possibly be used to issue commands (so-called 'dangerous characters' or whatever). If any of these characters are found anywhere in a variable, then the input will be rejected and an error message returned. Thanks Michael Hall ----- Original Message ----- From: jeremy brand <jeremy@nirvani.net> To: Michael Hall <mulgaweb@mulga.com.au> Cc: <php-general@lists.php.net> Sent: Friday, September 29, 2000 5:07 PM Subject: Re: [PHP] regex > what string? a regular expression has to be crafted based on what > you're looking for. Let us know what string you are trying to get and > we can help. > > :) > -jeremy brand > _______________________________________________________________________ > GnuPG Fingerprint: 9F5E 95E0 1CC2 E054 84EA 6099 8ACD 9DBA D2C0 5EA9 > _ http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for > more __ > _ http://www.google.com/search?q=jeremy+brand > __ > > On Fri, 29 Sep 2000, Michael Hall wrote: > > > Date: Fri, 29 Sep 2000 17:15:22 +0930 > > From: Michael Hall <mulgaweb%mulga.com.au@octa4.net.au> > > Reply-To: Michael Hall <mulgaweb@mulga.com.au> > > To: php-general@lists.php.net > > Subject: [PHP] regex > > > > Hi: > > > > Anyone know of a quick and simple regex formula that will find *any* > > instance of a given set of characters anywhere in a string? I'm not too > > flash with regex, and tried something like the following: > > > > ereg("[\/\\\%\&\*\|\!\<\>]", $string); > > > > This appeared to work sometimes, not others, and less as the set of > > characters to search for got longer. I simply want to block outright certain > > undesirable characters ... > > > > Thanks > > Michael Hall > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > _____________________________________ M U L G A W E B S E R V I C E S Open Source Web Solutions mulgaweb@mulga.com.au * www.mulga.com.au Ph/Fax (08) 8953 1442 * Alice Springs, NT _____________________________________

« previous php.general (#18015) next »