replace_pattern
ReplacePattern replaces all regex matches within the string value.
ReplacePattern replaces all regex matches within the string value. Supports capture group references (e.g. $1) in the replacement string.
Input
string
Parameters
| # | Type | Required |
|---|---|---|
| 0 | string | yes |
| 1 | string | yes |
Returns
string
Examples
{{ text | replace_pattern:'\s+','' }}
{{ slug | replace_pattern:'[^a-z0-9\-]','' }}How is this guide?