extractx

To extract a string from a given text using a regular expression

With this function, you can extract the first match of a search string in a text.

Instead of simple strings as a search pattern, you can use regular expressions (regex). That means you have much more possibilities for text analysis.

You could use this function for example to extract relevant information from imported data.

Using regular expressions might need some extra research. We recommend checking regular expressions on https://regex101.com/ (external link).

Syntax

extractx(string, string)

extractx(string, string, string)

extractx(string, string, string, string)

Returns

string

Examples

extractx(myText, regex, flags, extract) To extract a string from a given text using a regular expression. Flags can be added to the regular expression. The string can be further processed with a given extract.

We have a database with some records in it. We also have …

  • an image field My attachment with a file ImportantDocument.pdf

  • a formula field File name

Open the field settings of your formula field File name and add the following script to the formula field Formula:

extractx(text('My attachment'), "(.+)\/(.+)", "i", "$2")

Result: In the formula field you will see the name of the attachment: ImportantDocuement.pdf

extractx(myText, regex, extract) To extract a string from a given text using a regular expression. The string can be further processed with the given extract.

extractx(myText,regex) To extract a string from a given text using a regular expression.

See also

replacex, which replaces matches of a given regular expression.

substr, which returns a new string out of a given text.

testx, which returns true if a given text matches a given regular expression.

Last updated