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.