Consulting

Results 1 to 2 of 2

Thread: regular expression to extract 10 digit number

  1. #1
    VBAX Regular
    Joined
    Feb 2006
    Posts
    28
    Location

    regular expression to extract 10 digit number

    Hi,I'm wondering how to use a regular expression to find a 10 digit number in any email, i.e. a new email arrives, and a sub or function searches the email for a 10 digit number and holds it in a variable.... any ideas?Cheers

  2. #2
    VBAX Regular
    Joined
    Feb 2006
    Posts
    28
    Location
    Guys,I've got this [/code]Sub ValidFileName() Dim RegEx As Object Dim number As Long number = 123456789 Dim valid As Boolean Set RegEx = CreateObject("vbscript.regexp") RegEx.Pattern = "\d{10}" valid = RegEx.test(number) Set RegEx = NothingEnd Sub[code]i just need to use a find method to run through the emails?

Posting Permissions

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