You are here: Re: [PHP] User Passwords: checking for unique chars « PHP « IT news, forums, messages
Re: [PHP] User Passwords: checking for unique chars

Posted by Jochem Maas on 09/28/73 11:08

Alex Gemmell wrote:
> On Mon, 14 Feb 2005 22:51:42 +0100, Jochem Maas <jochem@iamjochem.com> wrote:
>
>>Alex Gemmell wrote:
>>

....


>
>
>>> #Contain at least one number
>>> if ( !preg_match ('/\\d/', $password) ) return false;
>>
>>Im pretty sure the double backslash is a typo.
>>here are some regexps from a php5 class I use:
>>
>
>
> Intersting you should say that because I was told to escape my slashes
> in this case, otherwise I wouldn't have either. I've tested it and it
> works so...
>

well you have to escape the bslash if your using double quotes.
there is a reason sane people (normally) write regexps in php
using single quotes :-)

php -r " echo '\d';"
php -r ' echo "\n";'
php -r " echo '\\d';"
php -r ' echo "\n";'
php -r ' echo "\\d";'
php -r ' echo "\n";'
php -r ' echo "\\\\d";'
php -r ' echo "\n";'

don't ask (me) why this is so. I just learn how from bitter experience :-),
the why for greater mortals than I.

>>
>
> Thanks Jochem - all advice much appreciated.
>

you might curse me in the long term ;-)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация