Skip to content Skip to footer navigation
You are reading the docs for an old version of Statamic. Consider upgrading to Statamic 6.

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.