Condition in InfoPath 2013 Email Validation |
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
Post a Comment