Skip to main content

Regex Extract

Category: Processing

Description: Finds and extracts all substrings in a piece of text that match a regular expression pattern, outputting both the full list of matches and the first match.

info

Uses linear-time RE2 regular expression syntax to safely extract patterns.

Default​

Inputs​

NameTypeRequiredDescription
TexttexttrueThe text to extract matches from
PatterntexttrueThe regular expression pattern to search for

Outputs​

NameTypeDescription
Matchestext-arrayAll matching substrings found in the text
First MatchtextThe first matching substring found

Output Event Triggers​

Name
Matched
Not Matched
Error

Examples​

Extract hashtags​

Inputs

  • Text:

    "Check out #news and #updates!"
  • Pattern:

    "#[a-zA-Z0-9_]+"

Outputs

  • Matches:

    [
    "#news",
    "#updates"
    ]
  • First Match:

    "#news"