WARNING: Version 5.4 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
pattern_replace token filter allows to easily handle string
replacements based on a regular expression. The regular expression is
defined using the
pattern parameter, and the replacement string can be
provided using the
replacement parameter (supporting referencing the
original text, as explained
Beware of Pathological Regular Expressions
The pattern replace token filter uses Java Regular Expressions.
A badly written regular expression could run very slowly or even throw a StackOverflowError and cause the node it is running on to exit suddenly.
Read more about pathological regular expressions and how to avoid them.