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

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

How to pay Cebu Pacific Booking using BDO Online Banking

For those of you who doesn't have a credit card but has BDO accounts and is registered to BDO Online banking at  https://online.bdo.com.ph , it would be easier for you to pay your bookings at Cebu Pacific website because CEBU PACIFIC AIR does not require enrollment in BDO online banking anymore.  Below is the detailed documentation on how I paid my Cebu Pacific Booking using BDO ATM that is registered to BDO Online Banking. The first thing to do is to make it sure that you have selected the fifth tab in where the BDO payment choice is listed. Look at the photo above. 1. Login to BDO Online Banking at  https://online.bdo.com.ph 2. Click on The "Pay Bills" icon located at the left under "My Quick Links". See FIGURE 1 below. FIGURE 1 (Screen Grab from BDO Online Banking) 3. If you have multiple accounts registered on your BDO Online banking, select account where you pay from by clicking on the drop-down. (See FIGURE 2 # ...