Skip to main content

StripAfterTransformer

Removes all content following the first occurrence of the specified pattern.

Notesโ€‹

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

Examplesโ€‹

The above example will strip all text starting with the following HTML comment and everything after it: <!-- FOOTER -->.

handler:
class: StripAfterTransformer
inclusive: true
stripAfterMatcher:
method: REGEX
pattern: <![CDATA[<!-- FOOTER -->]]>

Usageโ€‹

Full configuration skeleton, with every option and its default
class: StripAfterTransformer
fieldMatcher:
ignoreCase: false
ignoreDiacritic: false
matchEmpty: false
method: BASIC
negateMatches: false
partial: false
pattern: string
replaceAll: false
trim: false
inclusive: false
label: string
maxReadSize: 0
sourceCharset: string
stripAfterMatcher:
ignoreCase: false
ignoreDiacritic: false
matchEmpty: false
method: BASIC
negateMatches: false
partial: false
pattern: string
replaceAll: false
trim: false

Propertiesโ€‹

PropertyTypeRequiredDefault
fieldMatcherTextMatcherNoTextMatcher
inclusivebooleanNofalse
labelstringNo-
maxReadSizeintegerNo10000000
sourceCharsetstringNo-
stripAfterMatcherTextMatcherNoTextMatcher

Property Detailsโ€‹

fieldMatcherโ€‹

Matches document fields based on specified patterns and methods

inclusiveโ€‹

Whether the matched text is stripped along with everything after it. Default is false, which leaves the match itself in place and strips only what follows.

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

sourceCharsetโ€‹

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

stripAfterMatcherโ€‹

Specifies the pattern to match for stripping content after.