Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

.net 2.0 regular expression

Options
  • 13-12-2006 5:05pm
    #1
    Registered Users Posts: 7,468 ✭✭✭


    \w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
    

    Above is an expression to validate a given email address as being in the correct format. What I want to do now is make sure the address is at least 6 characters long as well. Any ideas?


Comments

  • Closed Accounts Posts: 884 ✭✭✭NutJob


    REF:
    [url]http://www.regular-expressions.info/reference.html[/url]
    
    {n,} where n >= 1
    
    
    Repeats the previous item at least n times. Greedy, so as many items as possible will be matched before trying permutations with less matches of the preceding item, up to the point where the preceding item is matched only n times.
    

    you will have to tweak ur expression a little

    dont look here
    http://www.regular-expressions.info/email.html :-)


    If you dont have it use this
    http://renschler.net/RegexBuilder/


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Thank for that. I get that {n,m} is going to have to go into the expression somewhere. I just can't work out where :(

    Anywho, I shall persevere ...


Advertisement