Skip to main content

StripBetweenTransformer

Removes any content found between a matching start and end strings.

Notesโ€‹

The matching strings are defined in pairs and multiple ones can be specified at once.

This class can be used as a pre-parsing (text content-types only) or post-parsing handlers.

Examplesโ€‹

The following will strip all text between (and including) these two HTML comments: <!-- SIDENAV_START --> and <!-- SIDENAV_END -->.

handler:
class: StripBetweenTransformer
operations:
- inclusive: true
startMatcher:
method: REGEX
pattern: <![CDATA[<!-- SIDENAV_START -->]]>
endMatcher:
method: REGEX
pattern: <![CDATA[<!-- SIDENAV_END -->]]>

Usageโ€‹

Full configuration skeleton, with every option and its default
class: StripBetweenTransformer
fieldMatcher:
ignoreCase: false
ignoreDiacritic: false
matchEmpty: false
method: BASIC
negateMatches: false
partial: false
pattern: string
replaceAll: false
trim: false
label: string
maxReadSize: 0
operations:
- endMatcher: {}
inclusive: false
startMatcher: {}
sourceCharset: string

Propertiesโ€‹

PropertyTypeRequiredDefault
fieldMatcherTextMatcherNoTextMatcher
labelstringNo-
maxReadSizeintegerNo10000000
operationsStripBetweenOperation[]No-
sourceCharsetstringNo-

Property Detailsโ€‹

fieldMatcherโ€‹

Matches document fields based on specified patterns and methods

labelโ€‹

An optional, user-supplied label for this step in the importer pipeline. It has no effect on processing โ€” it exists purely to help identify this step, for example in large configurations or in the visual configurator.

maxReadSizeโ€‹

Max characters to read at once

operationsโ€‹

Allows defining multiple operations as a list.

sourceCharsetโ€‹

Sets the character encoding of the source document to ensure proper reading and processing.