Definition and Usage
The Match with RegEx command is used to search a text string for all occurrences of a regular expression. It allows testing if a pattern exists in an input string as part of operations like search, extract, replace and validation. Common use cases include:
Extracting data or substrings from strings
Verifying if a string matches an expected format
Standardizing/normalizing data formats
Parsing and extracting structured data from documents
Redacting sensitive information
Parameter Values
Set Parameters
Parameter | Description |
Original text | Enter the text to match or select a text variable |
RegEx | Enter a regular expression |
Match the first occurrence only | Match the first occurrence only |
Ignore case | Specify if you'd like to use case-sensitive or case-insensitive matching |
Save match text as | Save the matched text as a new variable |
Error Handling
Parameter | Description |
When error occurs | Select the action to be performed when an error occurs
|
💡Tip:
The RegEx tool follows the same logic as the tool in the Octoparse web scraping tool. For a detailed explanation, please check this article.
Example
The above workflow will match the email address from "mailto:[email protected]" with the RegEx tool. The RegEx is set to match a string starting from and do not include the ":" symbol. The final output will be "[email protected]".