Just venturing into Reg Exps

Results 1 to 2 of 2

Thread: Just venturing into Reg Exps

  1. #1
    Join Date
    Dec 1969

    Default Just venturing into Reg Exps

    I've read the stuff in the 4Guys Reg Exp index, but still feel very lacking in knowledge about this aspect of coding. I'm stuck doing something so simple as detecting an email address. I based what I'm currently working with off of the URL linker Reg Exp in the index at 4Guys, but that one just checks for no white space immediately surrounding the '@'(I think), I want it to look for the '@' as well as a '.' somewhere after the '@', but before a space. I'm totally stumped on how to do it, because there could be any number of characters between the '@' and the '.'

  2. #2
    Join Date
    Dec 1969

    Default RE: Just venturing into Reg Exps

    Head on over to msdn.microsoft.com/scripting and check out the vbscript docs and within those check out the regular expression area.<BR>As to your question, a bit of research on this site and you will have no problem finding the answer but as a quick hint.<BR><BR>We know there are possible numeric and alpha chars in an email address.<BR>We know that there can be multiple "."s after the "@"...Andrew@home.msn.com type email addresses<BR>So looking at that for example we can look at the "pattern after the "@" sign will be something like this.<BR>We also know you want to include a space at the end of the email. This quick example also assumes that the compared value is trimmed otherwise the ending s would be s+ to allow for untrimmed white space characters and also possible newline, other space characters.<BR><BR>@(w.)+(w{3})s<BR><BR>You still have the first part which can be something like this.."andrew_900@" or "andrew94a_test@home.com". The sample above is completly off my head and probably wont even work but then again the fun part of regular expressions are testing, testing, testing. I hope this gives you enough of a direction to get you started, If you have more questions post em on up and we will answer them as quickly as possible.<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts