Examples/Module: dplreplace (example 3)
< Examples
Example
Replaces "a" with "A" if there is an "r" somewhere after the "a". The \1
references the group found between the "a" and "r" and puts it back into the replaced string.
Matches, with the group match in (): "a(br)", "a(kadabr)".
{{#dplreplace:abrakadabra|/a(.*?r)/|A\1}}
Result
{{#dplreplace:abrakadabra|/a(.*?r)/|A\1}}