<replaceAll>
The pattern search is stream-oriented, not line-oriented, i.e. matches are found even across line boundaries.
Thus the pattern typically enables
(?m) (multi-line mode)
and/or
(?s) (dotall mode).
This filter reader is semantically almost equivalent with
<tokenfilter>
<filetokenizer />
<replaceregex
pattern="regex"
flags="s"
replace="replacement-string"
/>
</tokenfilter>
, but is much more efficient in many cases, because the <filetokenizer /> always reads the entire content
into memory, while <replaceAll /> processes the content in a "sliding" manner which requires only very
little memory if the regex matches relative short sequences.
| Name | Description |
|---|---|
pattern="..."
|
The pattern to search for in the content. |
replacementExpression="..."
|
A "replacement expression" to use for the substitution of each match. |
replacementString="..."
|
The "replacement string" to use for the substitution of each match. |
| Name | Description |
|---|---|
<pattern>
|
Another replacement specification (this filter reader can execute multiple replacements in a row). |
Default values are underlined.
replacementString="replacement-string"<pattern>pattern="pattern"replacementString="replacement-string"replacementExpression="replacement-expression"Usage example:
replacementExpression="m.group.toUpperCase()"
Copyright © 2019. All rights reserved.