Extract Regex Groups directive
Extract Regex Groups directive
The EXTRACT-REGEX-GROUPS
directive extracts the data from a regex group into its own column.
Syntax
extract-regex-groups :column 'regex'
The directive generates additional columns based on the specified regex
This ignores the $0
regex group.
Usage Notes
If multiple groups are matched, the directive creates multiple columns.
The base name of the column is appended with the match count and match position the pattern is matched for: <column>_<match-count>_<match-position>
.
Example
Using this record as an example:
{
"title": "Toy Story (1995)"
}
Applying this directive:
extract-regex-groups :title [^(]+\(([0-9]{4})\).*
results in this record:
{
"title": "Toy Story (1995)",
"title_1_1: "1995"
}
The field title_1_1
follows the format of <column>_<match-count>_<match-position>
.
, multiple selections available,
Related content
Find and Replace directive
Find and Replace directive
Read with this
Parse as CSV directive
Parse as CSV directive
More like this
Parse as JSON directive
Parse as JSON directive
More like this
Parse as Simple Date directive
Parse as Simple Date directive
Read with this
Extracting fields
Extracting fields
More like this
Cut Character directive
Cut Character directive
More like this
Created in 2020 by Google Inc.