Search

 

Module: Editor

Version: 19.12 +

Type: String

Category: Text

 

Description

With this formula you can replace values in a text based on a regular expression. 

Parameters

Input string:

The input string to search

RegEx pattern:

The regular expression pattern to match

Replacement text:

The text to replace an occurrance of the RegEx pattern with. With this text you can use $0 or $1 to use values that are found in the RegEx pattern. See the external link how the values $0 and $1 refer to values in the text. The $0 is the full match, and the $1 is group 1. See at the right below 'Match information'.  

Example

Description

We have a sample where we want to replace a link tag in an HTML string with a HTML link

Values parameters

Input string:

This is a sample text containing a link <link>testlink</link>. And another link <link>testlink2</link>

RegEx pattern:

<link>(\w*)<\/link>

Replacement text:

<a href="tooltip('$1')">$1</a>

Result

This is a sample text containing a link <a href="tooltip('testlink')">testlink</a>. And another link <a href="tooltip('testlink2')">testlink2</a>

Related Topics

- Formula ValidatePattern: ValidatePattern 

External Links

- Sample page in RegEx editor: In this sample page in an online RegEx Editor you can edit the sample and see the result. Please be aware that this site uses a different format for the fields in the replacement text. Instead of $1 they use \1.

Feedback

If you have any questions about this subject or if you want to provide us feedback please send us an e-mail.

Updated: 2019-12-17