You are here: Re: [PHP] RegEx help « PHP « IT news, forums, messages
Re: [PHP] RegEx help

Posted by Tom Rogers on 10/19/74 11:13

Hi,

Thursday, April 14, 2005, 11:47:13 PM, you wrote:
BD> I wanted to create a regex that force a PHP form text field to meet the
BD> following requirements:

BD> a. Must contain an 1 uppercase letter. [A-Z]

BD> b. Must contain 1 digit. [0-9]

BD> c. Must be a minimum of 7 characters in length. {7}



BD> I'm not sure of how to build the correct syntax for using all 3
BD> requirements together.

BD> Any help?



BD> Thanks,

BD> Dave







BD> HTC Disclaimer: The information contained in this message
BD> may be privileged and confidential and protected from disclosure.
BD> If the reader of this message is not the intended recipient, or an
BD> employee or agent responsible for delivering this message to the
BD> intended recipient, you are hereby notified that any
BD> dissemination, distribution or copying of this communication is
BD> strictly prohibited. If you have received this communication in
BD> error, please notify us immediately by replying to the message and
BD> deleting it from your computer. Thank you.

easier done seperately I think
if(
strlen($text) > 6 &&
preg_match('/\d+/',$text) &&
preg_match('/[A-Z]+/',$text)
) { echo 'OK <br>';

--
regards,
Tom

 

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

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