Match Regular Expression function
Appearance
| Object information | |
|---|---|
| Owning palette(s) | String palette |
| Type | Function |
| Requires | Basic Development Environment |
| Icon | |
The Match Regular Expression function searches for a regular expression in the input string beginning at the offset you enter. If the function finds a match, it splits the string into three substrings and any number of submatches. Resize the function to view any submatches found in the string.
Usage

| Data Type | Name | Required? | Description |
|---|---|---|---|
| multiline? | No | multiline? specifies whether to treat the text in input string as a multiple-line string. This setting affects how the ^ and $ characters handle matches.
| |
| ignore case? | No | ignore case? specifies whether the string search is case sensitive. If FALSE (default), the string search is case sensitive. | |
| input string | Yes | input string specifies the input string the function searches. This string cannot contain null characters. | |
| regular expression | Yes | regular expression specifies the pattern you want to search for in input string. If the function does not find a match, whole match and after match contain empty strings, before match contains the entire input string, offset past match returns –1, and all submatches outputs return empty strings. Place any substrings you want to search for in parentheses. The function returns any substring expressions it finds in substring 1..n. This string cannot contain null characters. | |
| offset | No | offset specifies the number of characters into input string at which the function starts searching for search string. | |
| error in | No | error in describes error conditions that occur before this node runs. This input provides standard error in functionality. |
Best practice
Tips and tricks
- Use back references to refer to previous partial matches in a regular expression.
\1refers to the first partial match,\2to the second, and so on. For example,(cat|dog) \1matches "cat cat" or "dog dog" but not "cat dog" or "dog cat".