regexliteral(
regexliteral(
TEXT
)

The regexliteral( function adds characters to text as necessary so that it can be used as a literal in a regular expression.

Parameters

This function has one parameter:

text – The text to be used as a regular expression literal.

Description

Use this function if you need to use the text in a Panorama field or variable as literal text within a regular expression. The function adds backslash (\) characters in front of any characters that normally would have special meaning within the regular expression (*, |, $, *, ., +, etc.)

    regexliteral(".") ☞ \.
    regexliteral("William H. Smith Jr., D.D.S.") ☞ William H\. Smith Jr\., D\.D\.S\.

This function is normally used in conjunction with the regular expression operators and functions like regexmatch, regexarray( and regexreplace(. For example, suppose you want to find all occurrences of someone’s name in parentheses. The formula below will do the trick even if the name contains periods or other characters with special meaning in regular expressions.

    regexarray(page,"\("+regexliteral(Name)+"\)")

See Also

- regexarray( -- applies a regular expression to a text value, then builds an array containing all of the substrings that match the regular expression (see Regular Expressions).
- regexarrayexact( -- applies a regular expression to a text value, then builds an array containing all of the substrings that match the regular expression (see Regular Expressions).
- regexmatch -- checks to see if the text on the left matches the regular expression on the right (see Regular Expressions).
- regexmatchexact -- checks to see if the text on the left matches the regular expression on the right (see Regular Expressions).
- regexreplace( -- replaces text with new text. The text to be replaced is determined by a regular expression.
- regexreplaceexact( -- replaces text with new text. The text to be replaced is determined by a regular expression.
- regexreplacefirst( -- replaces the first occurrence of a regular expression pattern with new text.
- regexreplacefirstexact( -- replaces the first occurrence of a regular expression pattern with new text.
- Regular Expressions -- Regular expressions can be used to look for a specified pattern in text and then specify what to do with each pattern match that is found

History

Version | Status | Notes
10.0 | New | Regular expression support is new in this version