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...

Danggawan Elementary School Graduation 2016 | Speech of Jeffry Manhulad as a Guest Speaker

Sa atong mga tinahod nga bisita nga ania karong buntaga, ang akong pagtahod kaninyo, sa atong mga bootang maestro og maestra, mga opisyales sa barangay og sa atong katilingban, maayong bontag. Sa atong mga ginikanan, ang akong pagsaludo kaninyong tanan. Og usab, sa walay pabor-pabor, sa atong mga estudyante, kining panahona para kini kaninyo. Magsadya kamo kay sa pila katuig nga kamo nagbalik-balik dinhi sa tunghaan aron kamo makalampos, sa katapusan, pwede na kamo musinggit karon "Of all my sleepless nights, thank you Lord! At last, I am graduation!" Sa sulod sa pila ka tuig maka-ambak na gayud kamo sa sunod nga ang-ang paingon sa inyong paglambo. Ako nasayod nga inyo kining gipangandoy nga panahon, nga kamo mupaso sa entablado isip usa sa mga graduates dinhi karon. Dugay na kini ninyong gipangandoy uban sa inyong pamilya og sa mga tawong pirme nagasuporta kaninyo. Congratulations! Ani-a na kamo dinhi karon! Kita man siguro tanan adunay pan...