RE: [PHP-DB] regular expression help

2004-06-24 Thread Matt Matijevich
[snip] That does not work either... I can not make the statement fail!!! I have tried $password = "123456"; and $password = "abcdef"; I have change the if statement to what is below and past in all letters and it still works? if (preg_match ('/\d/', $password)) { die ("You must have a numb

RE: [PHP-DB] regular expression help

2004-06-24 Thread Matt Matijevich
you only want to check to see if there is at least one digit? If that is true, this should work: if(preg_match('/\d/',$password)) { echo 'password ok'; } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] regular expression help

2004-06-24 Thread Matthias Steinböck
hat there is at least 1 number in the password ? // Larry -Original Message- From: Matthias Steinböck [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 1:41 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] regular expression help hi! is this correct: you want to check if there are

Re: [PHP-DB] regular expression help

2004-06-24 Thread Matthias Steinböck
ok... this still does not do what you want, because it does not consider that only digits should be between the letters... here is the correct solution: // dies $password = 'alfgoesswimming'; // dies too $password = 'a2lf4g2o4e7s9s3w9i0m5m7i0n3g'; // survives $password = 'a2$5l5f4g2o4e7s9s3w9i0

RE: [PHP-DB] regular expression help

2004-06-24 Thread Matthias Steinböck
hi! is this correct: you want to check if there are two letters in the password wich do not surround a digit? if so this is what you need: // dies $password = 'alfgoesswimming'; // dies too $password = 'a2lf4g2o4e7s9s3w9i0m5m7i0n3g'; // survives $password = 'a2l5f4g2o4e7s9s3w9i0m5m7i0n3g'; $foun

RE: [PHP-DB] regular expression help

2004-06-24 Thread Larry Sandwick
die ("You must have a number between 2 letters in your password ... 0-9"); // Larry -Original Message- From: Matt Matijevich [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 12:11 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP-DB] regular expression hel

Re: [PHP-DB] regular expression help

2004-06-24 Thread Matt Matijevich
try this $password = 'abcdef'; if (preg_match ('/\w\d\w/', $password)) { die ("You must have a number between 2 letters in your password ... 0-9"); } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] regular expression help

2004-06-24 Thread Larry Sandwick
The *if* statement should fail with the password abcdef being qualified but it never fails ? If I understand the expression right, it should have at 1 number in it between 2 letters ? $password = abcdef; if (preg_match ("/[A-z]+[0-9]+[A-z]+/", $password)) { die ("You must have a n