Hi,

I'm trying to validate page range data. This can be entered as (example)
i-ix,1,23-45. I am trying to ensure that, where the user is pasting data
from a web page, for instance, that uses an 'n-dash' rather than a hyphen
(but could use something else), that the user is alerted to re-type the
data.

my function is:

function validate_pr($pr){
   $regexp = "([ilmvxcd0-9-]+)";
   $valid = 0;
   if (eregi($regexp, $pr)){
                $valid = 1;
        } else {
                $valid = 0;
        }
   return $valid;
}

but when tested, it just ignores the n-dash and accepts it.

Am I doing something wrong, or is there another test I could use?

MTIA

George

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to