Tag Link | [String_ReplaceRegExp] | Category | String |
---|---|---|---|
Type | Substitution | Source Available | No |
Support | Preferred | Version | 5.0 |
Change | Unchanged | Data Source | Any |
Output Type | String | Security | None |
Implementation | LCAPI | Sets | Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0 |
[String_ReplaceRegExp] takes three parameters: a string value, a
The following matching symbols are available in regular expressions. Each of these symbols matches a single character. Multiple characters are matched by combining these symbols with the combination symbols in the next table.
Note - Regular expressions in Lasso require double backslashes as shown in the listing below.
a
. - Period matches any single character.
^ - Circumflex matches the beginning of a line.
$ - Dollar sign matches the end of a line.
\\... - A backslash escapes the next character. \\\\ represents a backslash.
[...] - Square brackets create a character class matching any character included inside.
[^...] - With a carat, any character other than those included inside is matched.
[a
\t - A tab character.
\r - A return character.
\n - A new
\" - A double quote.
\' - A single quote.
\\w - Matches any alphanumeric character or an underscore.
\\W - Matches any non
\\s - Matches a whitespace character (space, tab, return, etc.).
\\S - Matches a non
\\d - Matches a numeric digit.
\\D - Matches any non
The following combination symbols are used to combine matching symbols into complex expressions. For example a+ would match one or more a characters.
| - Alternation. Matches either the character before or the character after the symbol.
( ) - Grouping. Defines a named group for output. Nine pairs of parentheses can be defined.
* - Asterisk matches 0 or more repetitions of the preceding character.
+ - Plus sign matches 1 or more repetitions of the preceding character.
? - Question mark matches 0 or 1 repetitions of the preceding character.
{n} - Matches n repetitions of the preceding character.
{n,} - Matches at least n repetitions of the preceding character.
{n,m} - Matches at least n, but no more than m repetitions of the preceding character.
In the replacement pattern the following additional symbols can be used.
\\1 ... \\9 - An escaped number substitutes in the specified group (defined by parentheses) from the source.
[String_ReplaceRegExp: String Value,
[String_ReplaceRegExp: String Value,
[String_ReplaceRegExp: String Value,
Required Parameters | |
---|---|
String Value | The string which should be modified. |
-Find | The regular expression which should be found. |
-Replace | The replacement value for each instance of the search regular expression that is found. |
Optional Parameters | |
Encoding Keyword | Specifies the encoding for the tag's return value. Tags are encoded using |
-ReplaceOnlyOne | If specified only the first instance of the search expression is replaced. Otherwise, all instances of the search expression are replaced. |
-IgnoreCase | If specified case is ignored when replacing the search expression within the target string. |
-Matchlimit | By default Lasso uses a recursive match limit depth of 100,000. This parameter can be used to modify the match limit if Lasso reports an error when using this tag. |
To replace an email address with a mailto link:
Use the [String_ReplaceRegExp] tag. The following example replaces any email address in the source with an HTML anchor tag that allows visitors to send email to the address.
[String_ReplaceRegExp: 'Send email to lassodocumentation@omnipilot.com',
Send email to <a href="lassodocumentation@omnipilot.com"> lassodocumentation@omnipilot.com </a>