Form CTAs allow you to collect data entered by users. JotUrl does not validate this data in any way, but classifies it simply by distinguishing the email addresses from what is not an email address. However, it is possible to insert a validation using JavaScript regular expressions: in the last step of the CTA form click on advanced options and enter a regular JavaScript expression for validation.
The user interface also allows you to check the entered regular expression, just click on Check, a validation interface will be displayed.

The JavaScript RegExp Object
A regular expression is an object that describes a pattern of characters.
Regular expressions are used to perform pattern-matching and "search-and-replace" functions on text.
Syntax
The syntax of a regular expression object is
/pattern/modifiers
For example:
- /joturl/i is a regular expression
- joturl is a pattern
- i is a modifier
For a complete tutorial and reference please perform search on the Internet for JavaScript Regular Expression Reference.
Common Regular Expressions in Javascript
Here are a list of Common Regular Expressions in Javascript.
1. Digits
- Whole Numbers –
/^\d+$/ - Decimal Numbers –
/^\d*\.\d+$/ - Whole + Decimal Numbers –
/^\d*(\.\d+)?$/ - Negative, Positive Whole + Decimal Numbers –
/^-?\d*(\.\d+)?$/ - Whole + Decimal + Fractions –
/[-]?[0-9]+[,.]?[0-9]*([\/][0-9]+[,.]?[0-9]*)*/
2. Alphanumeric Characters
- Alphanumeric without space –
/^[a-zA-Z0-9]*$/ - Alphanumeric with space –
/^[a-zA-Z0-9 ]*$/
3. Email
- Common email Ids –
/^([a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6})*$/ - Uncommon email ids –
/^([a-z0-9_\.\+-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/
4. URL
- Include http(s) Protocol
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#()?&//=]*)/ - Protocol Optional
/(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/
5. Phone Numbers
- International Phone Numbers – with optional country code/extension
/^(?:(?:\(?(?:00|\+)([1-4]\d\d|[1-9]\d?)\)?)?[\-\.\ \\\/]?)?((?:\(?\d{1,}\)?[\-\.\ \\\/]?){0,})(?:[\-\.\ \\\/]?(?:#|ext\.?|extension|x)[\-\.\ \\\/]?(\d+))?$/

Comments
0 comments
Article is closed for comments.