• 0

[VB] Email reg ex


Question

Hi

I have a really nice regular expression that I have used in JavaScript for about 5 years no. It seems to conform to every rule and validates addresses well.

However, as good as I am with JavaScript, I must admit to copying this reg ex from elsewhere, and really don't know regular expressions well.

I am coding a VB app, and need a similar reg ex to validate an email in VB.

Anyone have any?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

www.regexlib.com has some good ones

EDIT: After re-reading your post, shouldn't the same regular expression work for both? Post your JS one

Link to comment
Share on other sites

  • 0

The syntax for VB and Javascript are different :(

However, here is my Javascript code

if (!(document.f1.cust_email.value.match(/^(\w|\-|\'|\.|\d|\,)+@((\w|\-|\'|\d|\,)+\.)+((\w|\d|,)+)$/i))){
    alert("Your e-mail address is invalid, please try again");
}

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.