Skip to main content

RegexFieldValueExtractor

Extracts field names and values from text using a regular expression with capture groups.

Notes

Applies a regular expression to document content or metadata and uses capture groups to extract a field name and its corresponding value. The fieldGroup and valueGroup properties identify which capture groups hold the field name and value respectively, and the extracted value is stored in the field specified by toField.

Examples

The following is configured to extract "DocNo" as the toField, and the following numeric characters will make up the value.

fieldGroup: 1
valueGroup: 2
regex:
pattern: (DocNo):(\d+)

Usage

Full configuration skeleton, with every option and its default
fieldGroup: 0
onSet: APPEND
regex:
canonEq: false
comments: false
dotAll: false
ignoreCase: false
ignoreDiacritic: false
literal: false
matchEmpty: false
multiline: false
pattern: string
trim: false
unicodeCase: false
unicodeCharacterClass: false
unixLines: false
toField: string
valueGroup: 0

Properties

PropertyTypeRequiredDefault
fieldGroupintegerNo-1
onSetenumNo-
regexRegexNoRegex
toFieldstringNo-
valueGroupintegerNo-1

Property Details

fieldGroup

The index of the regex capture group that contains the field name. When specified along with toField, the toField value acts as the default when no match is found for this group.

onSet

Defines what to do when the target field already has one or more values. When unspecified, new values are appended to existing ones by default.

Allowed Values

  • APPEND
  • PREPEND
  • REPLACE
  • OPTIONAL

regex

A regular expression pattern used for matching.

toField

The target metadata field name where the extracted or computed value will be stored. If a field of the same name already exists, the behavior is controlled by onSet.

valueGroup

The index of the regex capture group that contains the extracted value. If not specified, the entire regex match is used as the value.