Jump to content

Examples/Module: dplreplace (example 3)

From DynamicPageList4 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

[edit source]

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

[edit source]

AbrAkadabra

Cookies help us deliver our services. By using our services, you agree to our use of cookies.