I think the problem is poorly specified: what does "two words" really mean? Essentially which of these are two words?
abc1def2 ab_def12 _abcd12_ twowords12
All match against Edi's rather neat regex, but are they valid?
Is "_" part of a word or a word separator?
:)
-----Original Message----- From: regex-coach-bounces@common-lisp.net [mailto:regex-coach-bounces@common-lisp.net] On Behalf Of Edi Weitz Sent: Tuesday, September 27, 2005 2:13 PM To: Frank Cc: regex-coach@common-lisp.net Subject: Re: [regex-coach] Greetings and a puzzle
Hi!
On Tue, 27 Sep 2005 08:27:26 -0400, Frank lists@frankmarion.com wrote:
Hi, I'm new to the list. I was looking for a nice regex list, and found this one.
This is not a general regex list, it is specifically for the "Regex Coach" application.
A programmer wants to test a password, and he wants to do it in ONE expression. Here are the criteria for a well formed password
- Minumum of eight characters in length
- Two words [a-z_] are required
- Two digits [0-9] are required.
(?=.*[a-z_].*[a-z_])(?=.*[0-9].*[0-9]).{8,}
Cheers, Edi. _______________________________________________ regex-coach site list regex-coach@common-lisp.net http://common-lisp.net/mailman/listinfo/regex-coach
------------------------------------------------------------------------------ This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice.