Jump to content

Examples/Module: dplreplace (example 4)

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", 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

[edit source]

Ab_r_Akadab_r_a

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