Jump to content
This wiki has been automatically closed because there have been no edits or log actions made within the last 60 days. If you are a user (who is not the bureaucrat) that wishes for this wiki to be reopened, please request that at Requests for reopening wikis. If this wiki is not reopened within 6 months it may be deleted. Note: If you are a bureaucrat on this wiki, you can go to Special:ManageWiki and uncheck the "Closed" box to reopen it.

Dplreplace: Difference between revisions

m
Fix these to have working examples and add a note to come back to this
imported>FrozenPlum
mNo edit summary
imported>FrozenPlum
m (Fix these to have working examples and add a note to come back to this)
Line 2:
 
==Syntax==
<pre><nowiki>
{{#dplreplace:text|pattern|replacement}}
</nowiki></pre>
 
==Effect==
Line 13:
''replacement'' may contain references to matching parts.
 
==ExampleExamples==
<pre>
<nowiki> {{#dplreplace:abrakadabra|ab|AB}} </nowiki> returns: {{#dplreplace:abrakadabra|ab|AB}}
{{#dplreplace:abrakadabra|ab|AB}}
</pre>
Replaces "ab" with "AB".
 
<nowiki> {{#dplreplace:abrakadabra|/a(.*?)r/|A\1_r_}} </nowiki> returns: {{#dplreplace:abrakadabra|/a(.*?)r/|A\1_r_}}
 
'''Result:'''<br>
The second example only replaces "a" by "A" if there is an "r" somewhere after the "a".
{{#dplreplace:abrakadabra|ab|AB}}
 
<pre>
{{#dplreplace:abrakadabra|/a(.*?)r/|A\1_r_}}
</pre>
The second example only replacesReplaces "a" by "A" if there is an "r" somewhere after the "a".
{{note|This explanation is incomplete, it needs to be expanded to better explain what is taking place in the result.}}
 
 
'''Result:'''<br>
{{#dplreplace:abrakadabra|/a(.*?)r/|A\1_r_}}
 
[[Category:Other Modules]]
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.