Skip to content Skip to footer navigation

Regex Replace Modifier

Run a find and replace regex on a string of content.

description: This cat video is the best thing ever.
{{ description | regex_replace('best', 'okayest') }}
{{ Statamic::modify($description)->regexReplace(['best', 'okayest']) }}
This cat video is the okayest thing ever.