MaestroThe UI design product. | Form Builder | All versions This feature is related to all versions.
Maestro allows you to use Regular ExpressionsA regular expression (regex) is a sequence of characters that define a search pattern. Usually such patterns are used by string-searching algorithms for "find" or "find and replace" operations on strings, or for input validation. in validation rules, so you can created a pattern that will match character combinations in strings. A pattern makes use of special text strings, which are like wildcard notations in your OS. For example, as you can use a wildcard of *.txt
to find all text files in a File Manager, the regex equivalent is ^.*\.txt$
.
You can do much more with regular expressions. You could create the regular expression \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b
to search for any email address. A very similar regular expression (replace the first \b
with ^
and the last one with $
) can be used to check whether the user entered a properly formatted email address. Regular expressions are very compact, so it can be written in just one line of code.
In JavaScriptJavascript (JS) is a scripting languages, primarily used on the Web. It is used to enhance HTML pages and is commonly found embedded in HTML code. JavaScript is an interpreted language. Thus, it doesn't need to be compiled., regular expressions are also objects. These patterns are used with the exec and test methods of RegExp
, and with the match, replace, search, and split methods of String.
Below are several patters that can be handy to use:
It takes a bit of time to get familiar with RegExp and start using them correctly, so we recommend checking the following resources first :
To create a rule with a RegExp:
true
to indicate that the component is valid or false
to indicate that the component is invalid.
You can only attach one rule of each type to a component.
Next, learn how to create a Valid If Rule.