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

New Message on BDOTNET

-----------------------------------------------------------
From: rags_rao
Message 3 in Discussion

A difficult one!(but only becoz i had forgotten my FAFL lessons) but i wasnt gonna 
give up. was i?
/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[\W_]).*$/
thats ur reg exp. the key is to use noncapturing lookahead (?=) otherwise its 
straightfwd. it has 4 parts:
1. (?=.*[0-9]) or [\d] look for digit
and
2. (?=.*[A-Z]) look for CAPS
and
3. (?=.*[a-z]) look for no CAPS
and
4. (?=.*[\W_]) look for non-Alphanum
 \W includes everything except underscore (_) so an _  has 2 b added
........ya and the final .* is reqd without it u r not really macthing anything coz 
all the other parts dont capture anything here's javascript:.  var str =new 
Array("1234a","12Abdf)"/*valid*/,"1aA","asdF%^&","ascBGT","34^&*as","__ASDfg","234_*&^%sfDGH"/*valid*/);
for(var i=0;i<str.length;i++)
{    
    var _match = str[i].match(/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[\W_]).*$/);
    // or /^(?=.*[0-9])(?=.*[a-z])(?=.*[/d])(?=.*[\W_]).*$/
    if(_match) alert(_match); 
} looking fwd to more reg exps........ --
"The moths & atheists are doubly divine & dying"
- Jim morrison

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

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to