Please tell me I dont know regex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Please try below page/program on your system entering "ab-cd" and
please tell me I dont know regex - because the way I see it the
results of those tests should have been the same...

-----------------------------------------------------------------------

<html><body><form method=post action=<?php $PHP_SELF ?>
Please enter something with a dash here: <input type='text'
name='regex_test' />
<input type='submit' value='Submit' />
</form>

<?php
if (isset($_REQUEST['regex_test'])) {
 print "Testing ".$_REQUEST['regex_test'].' with regex
/^[A-Za-z0-9\._\-]{3,63}$/ ... :';
  if (ereg("^[A-Za-z0-9\._\-]{3,63}$",$_REQUEST['regex_test'])) print " Ok";
  else print " Nak";
 print "<br /><br />";
print "Testing ".$_REQUEST['regex_test'].' with regex /^[A-Za-z0-9\.\-_]{3,63}$/ ... :';
  if (ereg("^[A-Za-z0-9\.\-_]{3,63}$",$_REQUEST['regex_test'])) print " Ok";
  else print " Nak";
}
print "<br /><br />Current PHP Version is: ".phpversion();
?>

</body></html>

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux