Email validation pattern - InfoPath Dev
in

InfoPath Dev

Having trouble finding a blog or post that answers your question? Check out our Custom Search Page

Email validation pattern

Last post 05-01-2009 01:19 AM by Samir Farid. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 02-14-2007 08:24 AM

    Email validation pattern

    I found this from previous post: (.+)@(\w+)(\.\w+)*\.(\w{2,6})

    Can someone explain what it means?

    I don't see "\w" in IP, and have no idea about "{2,6}"

    Thanks.
  • 02-14-2007 11:04 AM In reply to

    Re: Email validation pattern

    Hi Troy0118,
    Excellent question. This is a regular expression. It is meant to map an e-mail address. The \w means word I think. Another example that matches e-mail address is: \b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b. You can usehttp://www.regular-expressions.info/index.html as a reference.
    Patrick Halstead
    Project Manager at Qdabra
  • 02-14-2007 11:24 AM In reply to

    Re: Email validation pattern

    Hi Patrick,
    really helpful, thanks.

    Troy
  • 04-24-2009 05:50 AM In reply to

    Re: Email validation pattern

    Hi,

    I dont understand this, but I tried to put:

    [A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}

    and

    \b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b

    and

    (\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b)

     In

    Button properties

    ->Set condition

    -> matches pattern

    ->custom pattern

    But it prompts:

    The pattern is not valid??? Why?

    I have tried another 5 different email patterns (based on various blogs) but none of them work correctly, but this is first time the pattern is not even accepted.  http://www.regular-expressions.info/index.html Is too much for me. I only want to now what is the correct pattern for email. Please help me.

    -Valtteri

  • 05-01-2009 01:19 AM In reply to

    Re: Email validation pattern

    Hi Valtteri,

    You can try this pattern. It covered 95 % all e-mail addresses that I can come up with.

    ([\w\-\.]+)@((\[([0-9]{1,3}\.){3}[0-9]{1,3}\])|(([\w\-]+\.)+)([a-zA-Z]{2,4}))

    But it still needs a small bit of fixing as it allows.

    ex. .@infopathdev.com / _@infopathdev.com ..etc

    Regards,

    Samir

Page 1 of 1 (5 items)
Copyright © 2003-2017 Qdabra Software. All rights reserved.
View our Terms of Use.