Examples/Module: dplreplace (example 4)
< Examples
Example
Replaces "a" with "A" if there is an "r" somewhere after the "a", and also replaces the "r" at the end of/outside the found group(s) with "_r_".
Matches, with the group match in (): "a(b)r", "a(kadab)r".
{{#dplreplace:abrakadabra|/a(.*?)r/|A\1_r_}}
Result
{{#dplreplace:abrakadabra|/a(.*?)r/|A\1_r_}}