Examples/Module: dplreplace (example 3)

From DynamicPageList3 Manual
Please do not edit this page unless you're wanting to edit the manual itself, it is an example included in the manual.

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}}