Regex
Description
This unit is a Processor unit type.
The Regex unit matches some text against a given RegExp, optionally providing captured groups as output event fields. RegExp uses Java syntax.
An event comes in through the in port. The regular expression set in the properties is executed and the match is performed.
Successful input events are enriched with new fields containing captured groups, and the event is output through the match port.
If an error occurs, the input event is enriched with new fields describing the problem, and the event is sent through the fail port.
Configuration
After dragging this unit into the Flow canvas, double-click it to access its configuration options. The following table describes the configuration options of this unit:
Tab | Field | Description |
---|---|---|
General | Name | Enter a name for the unit. It must start with a letter, and cannot contain spaces. Only letters, numbers, and underscores are allowed. |
Description | Enter a description detailing the scope of the unit. | |
Regular expression | Enter a Java regexp to determine the behavior of the unit. | |
Match field name | The name of the input event field containing text to be matched. | |
Unnamed field prefix | A prefix for output event fields containing unnamed capture groups. Leave empty if you do not wish to apply. | |
Find | Whether regexp is to match full text (false), or only part of it (true). |
Input ports
Port | Description |
---|---|
in | Events containing a field with text to be matched. |
Output ports
Port | Description |
---|---|
match | Outputs events enriched with a field containing the captured groups. For named groups, a field with that name is added. For unnamed groups, and if the unnamed Field Prefix setting is set, fields starting with that prefix and growing numeric suffixes (starting at 1) are added. |
fail | Signals when an error occurs and outputs input events, unmodified. |
Â