If I wanted to remove <script></script> tags from my form as well as <html>
tags, would I use a preg_match function or is their another simple funtion
that does this ?
-Dan
----- Original Message -----
From: "Jim Lucas" <[EMAIL PROTECTED]>
To: "Daniel J. Rychlik" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Saturday, May 31, 2003 6:04 PM
Subject: Re: [PHP] regex problem
> Are you wanting the $_POST['nums1'] to have only numbers, -, ., #, : ????
>
> Is this what you are trying to match. if so, try this.
>
> if ( preg_match("/[^0-9\#\:\.\-]/", $_POST['nums1']) ) {
> throw error()
> }
>
> This will match anything that is not a number or one of the other special
> chars that are in the pattern to be matched.
>
> Therefor, if it does find anything that is not in the pattern to be
matched
> it will return true and then it will enter the if statement instead of
> skipping over it.
>
> Jim Lucas
> ----- Original Message -----
> From: "Daniel J. Rychlik" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, May 31, 2003 11:46 AM
> Subject: [PHP] regex problem
>
>
> Hello,,
>
> I have a preg_match issue matching numbers. I am currently using
>
> !preg_match ('/([0-9\-\.\#:])/', $_POST['nums1']
> throw error[]
>
> This fails if you use something like ' asdf ' but if you use ' asdf789 '
it
> passes false and does not throw an error.
> This is not the obvious solution.... I know its a problem in my regular
> expression. Should I ONLY be using
>
> ' /([0-9])/ ' , ?
>
> Thanks in advance.
> Daniel
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php