Skip to main content

Regular Expression to Validate Email Address in InfoPath Forms 2013

Condition in InfoPath 2013 Email Validation
There is a simple and easy way to validate email address in your InfoPath fields, its a default regular expression in your InfoPath rules.

Its regular expression is just ".+@.+(\.)+" without the double quotes in it. Well, I dunno how to read regular expression but I think it just allows period before and after the @ symbol and also look for that @ symbol and that's it. (See figure below)

Pretty basic, but when I tried putting double quotes, single quotes, and other special characters as a field value in it, it doesn't validate as error, in which it must be validating because some characters are reserved characters in programming thereby causing fatal errors if not handled properly, right?

Default InfoPath Email Validation Regular Expression

Desperate to find a way to easily validate the data entered into my InfoPath email address field, I search on the web and found so many expressions and there are a bunch of them there for known programming language and tools. I copied and tried them but it just doesn't work, maybe because there's a different format for every tool and language? Well I guess so, some of the sample regular expression to validate an email address has a very long code and has brackets in it and some has parentheses and some would return an error when tested in an InfoPath form but when there's no brackets or parentheses it works.

Anyway, luckily I've found something cool, more awesome than the default regular expression email address validation of InfoPath. Its code is a bit longer, here it is: "([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)"

You can directly copy that code of course without the double quotations, I put it there to emphasize the code.

Just copy the code and paste it in the custom pattern field (See figure below)

Our custom pattern regular expression email address validation 

Be sure your condition looks like the first figure at the top, use "does not match pattern."

Your validation should now work and would not accept characters that are normally unacceptable in an email address.

Regular Expression came from https://monjurul.wordpress.com/email-address-validation-in-infopath/ 

Comments

Popular posts from this blog

PROVEN and TESTED: Step-by-step guide to Register Alumni Association with SEC Philippines

Registering and Incorporating your High School or College Alumni Association with the Securities and Exchanges Commission (SEC) is a straightforward process now especially that SEC already have an online process. Here is how we registered our Non-stock and non-profit alumni organization with the SEC in less than a month process. Prepare the personal information of your incorporators Before going to the SEC website, you will the the following information of your incorporators prepared: Complete name such as their first name, middle name, last name Birth date Address, and  TIN number Use the SEC eSPARC Online Company Registration Go to the SEC website and look for the Online Services and select SEC eSPARC and click on the Regular Processing. Alumni associations are non stock corporation so you won't be able to avail of the OneSEC Processing. Remember the following important step: Select the nearest SEC office from your area, you will need to bring the signed and printed copy later o

Reaction Paper for the movie The Count of Monte Cristo

The Second Part of the Reaction Paper on the Count of Monte Cristo Movie. The Count of Monte Cristo is a great story that helps you to realize how far the reaches of vengeance can really go. When the Count is going around ruining people it seems like he is more of a machine than a person. It seems like he has no emotions and can’t forgive the people who hurt him. Although some people might argue that the people who wronged the Count truly had what was coming to them, some of the Count’s actions could be seen as unnecessary. In the end everyone will be punished or rewarded by God and you shouldn’t be worried about what other people do or say as much as you are worried about yourself. “God will give me justice,” this line which was engraved in the wall on the prison was retained on my mind when I watched the movie” The Count of Monte Cristo.” This movie amazed me very much because of its excellent theme. I really like the story because it has a mixed of drama, suspense and rom

Pluggle Review: 6 Reasons Why I doubt Pluggle and Why I'm Not Joining

First thing first, I am not concluding that this Pluggle is a scam because as per my observation and as far as my knowledge is concerned, people including my close friends seems profiting from this scheme and got the money they invested into it in a short period of time, and with profit ( although I'm sure the return of investment they got was paid by the people they invited and not from the company itself ). I think there's no doubt as to their legitimacy because, YES they are legitimate and are registered with the Securities and Exchange Commission of the Philippines as PLUGGLE INC. Are they scam? " Scam " is defined as a " dishonest scheme or a fraud ", are they being dishonest? I think no because they intend to do what they say. Are they " fraudulent "? Fraud is defined as " wrongful or criminal deception intended  to result in financial or personal gain "? This is also vague but I think I was struck by the last pa