Lava Filters - RegExReplace

Category:Text

Description:Replaces a portion of the string passed as the input to the filter with Regular Expression matching.
Input: "Message": "Hello Ted, how are you?"
Lava: {{ 'The Rock is awesome.' | RegExReplace:'the rock','Rock','i' }} {% capture expression %}[Hh]ello (\w+){% endcapture %} {{ Message | RegExReplace: expression,'Greetings $1' }}
Output: Rock is awesome. Greetings Ted, how are you?