Capture
Capture processes values by capturing new values using regular expressions.
Interpretation Methods
The processor supports these interpretation methods:
- object
- data
Options
Field | Type | Description | Required |
---|---|---|---|
expression | string | the regular expression used to capture new values. | Yes |
type | string | determines which regular expression function is applied. must be one of: - find: applies the Find(String)?Submatch function- find_all: applies the FindAll(String)?Submatch function- named_group: applies the Find(String)?Submatch function and stores new values as objects using subexpressions | Yes |
count | integer | manages the number of repeated capture groups. defaults to match all capture groups. | No |
Use Cases
Creating New Objects
If the named_group type is used, then captured values are returned as a new object. For example, if the named_group expression is (?P<a>[a-zA-Z]+) (?P<c>[a-zA-Z]+)
, then the result is:
b d
{"a":"b","c":"d"}
Updated over 1 year ago