The REGEX Validations
Regex reffers to regular expresssions that can be used for validations on forms. FormTitan enables you to use REGEX expressionsinside the your "Value Rule". This allows you to prevent the user from entering data that is different from your REGEX definition.
In order to Set a value rule with REGEX all you have to do is:
1- | Drag a textbox element (or use one you already have in the form) |
2- | Set a value rule go to: "Properties" panel > "Element" tab > "Value Rule" category |
3- | Press on the "Set Value Rules" button |
4- | Configure your rule: choose REGEX from the drop down |
5- | Enter the expression in the rule textbox and press on "Apply". |
6- | Save the form. |
Example for REGEX may be found on the web. Here are a few:
Click here to see live REGEX examples
1- | Alpha-numeric characters only /^[a-zA-Z0-9]*$/ |
2- | Date (MM/DD/YYYY) /^(0?[1-9]|1[012])[- /.](0?[1-9]|[12][0-9]|3[01])[- /.](19|20)?[0-9]{2}$/ |
3- | Time (HH:MM) /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/ |
4- | Emails /^[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/ |
5- | Passwords /(?=^.{6,}$)((?=.*[A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z]))^.*/ |
6- | American Express Credit Card /^(3[47][0-9]{13})*$/ |
7- | Australian Postal Codes /^((0[289][0-9]{2})|([1345689][0-9]{3})|(2[0-8][0-9]{2})|(290[0-9])|(291[0-4])|(7[0-4][0-9]{2})|(7[8-9][0-9]{2}))*$/ |
8- | Canadian Provinces /^(?:AB|BC|MB|N[BLTSU]|ON|PE|QC|SK|YT)*$/ |
9- | Lowercase Alphabetic Characters /^([a-z])*$/ |
10- | MasterCard Credit Card /^(5[1-5][0-9]{14})*$/ |
11- | Phone Numbers (North American) /^((([0-9]{1})*[- .(]*([0-9]{3})[- .)]*[0-9]{3}[- .]*[0-9]{4})+)*$/ |
12- | Social Security Numbers /^([0-9]{3}[-]*[0-9]{2}[-]*[0-9]{4})*$/ |
13- | Uppercase Alphabetic Characters /^([A-Z])*$/ |
14- | 2-letter US State abbreviates /^(?:A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])*$/ |
15- | US ZIP Codes /^([0-9]{5}(?:-[0-9]{4})?)*$/ |
16- | Visa Credit Card /^(4[0-9]{12}(?:[0-9]{3})?)*$/ |
17- | UK Postal Codes /^([A-Z]{1,2}[0-9][A-Z0-9]? [0-9][ABD-HJLNP-UW-Z]{2})*$/ |
18- | URLs /^(((http|https|ftp):\/\/)?([[a-zA-Z0-9]\-\.])+(\.)([[a-zA-Z0-9]]){2,4}([[a-zA-Z0-9]\/+=%&_\.~?\-]*))*$/ |