Extract Text According To Pattern

Extract Text According To Pattern

Description

This action extracts matching parts from a text based on a pattern, and optionally trims the results.

Input Arguments

Input ArgumentTypeDescriptionRequired?Advanced Option?Default
TextStringText to be split up.✔️-
Match PatternStringPattern or text as part of the input text where it will splitted by.✔️-
Trim enabledBooleanRemoves leading and trailing whitespace in all results.✔️Yes
Trim StringsBooleanRemoves leading and trailing substring in all results.✔️whitespace

Output

ResponseTypeDescription
Text matches as listArrayA list of all text segments that matched the specified pattern.
Text matches as list itemStringA single match from the list, used e.g. in a loop/iteration.
bodyJSON ObjectJSON object containing the matches key with the array of extracted text.

Power Automate Examples

Extract Text

You can enter any kind of text in this field. In this example, the input contains order IDs: Order ID: 12345, Order ID: 67890, Order ID: 99999.

To extract specific parts of the text, such as numbers, a regular expression (RegEx) is used. In this case, we use the pattern \d+, which matches one or more digits.

Picture

💡

Looking for the response to this example? Scroll up to see the Output tab.

Known Limitations

⚠️
If you experienced other limitations please get in touch with us!