Anonymous user
Dplreplace: Difference between revisions
no edit summary
m (Alianin moved page DPL:Dplreplace to Extension:DPL3/Dplreplace without leaving a redirect) |
No edit summary |
||
Line 1:
{{DPL
=== Syntax ===▼
<pre><nowiki>
{{#dplreplace:text|pattern|replacement}}
</nowiki></pre>
==
▲ Replaces the given ''pattern'' within the ''text'' by ''replacement''.
''pattern'' is a regular expression as defined by php <code>preg_replace()</code>.
Line 15 ⟶ 13:
''replacement'' may contain references to matching parts.
==
<nowiki> {{#dplreplace:abrakadabra|ab|AB}} </nowiki> returns: {{#dplreplace:abrakadabra|ab|AB}}
Line 22 ⟶ 19:
The second example only replaces "a" by "A" if there is an "r" somewhere after the "a".
|