Difference between revisions of "Issue:Asking a parser "replace " demo"
From FollowTheScore
Roc michael (talk | contribs) (New page: {{Issue |Type = Change Request |Extension = DPL |Version = ? |Description = Asking a parser "replace " demo |Status = open }} == Problem == Hi Gero. Could you gi...) |
|||
(8 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
|Type = Change Request | |Type = Change Request | ||
|Extension = DPL | |Extension = DPL | ||
− | |Version = | + | |Version = all |
− | |Description = Asking a parser "replace " demo | + | |Description = Asking a parser "'''<nowiki>{{#replace: [[User:Michael|Roc Michael]] | from | to }}</nowiki>'''" demo |
− | |Status = | + | |Status = resolved |
}} | }} | ||
Line 10: | Line 10: | ||
Hi Gero. | Hi Gero. | ||
− | Could you give me | + | Could you give me the samples on using parser "replace" (or using other way) with following cases. for exapmle <nowiki>{{#replace: [[User:Michael|Roc Michael]] | from | to }}</nowiki> |
{|Class= wikitable width=100% | {|Class= wikitable width=100% | ||
− | ! | + | !Item |
− | !Before | + | !From (Before) |
− | !After | + | !To (After) |
|---- | |---- | ||
!Case 1 | !Case 1 | ||
Line 37: | Line 37: | ||
|align= center |Michael<br> and<br> 張三 | |align= center |Michael<br> and<br> 張三 | ||
|} | |} | ||
− | Please give me a hand. --[[User:Roc michael|Roc michael]] | + | Please give me a hand.--[[User:Roc michael|Roc michael]] 02:33, 20 December 2007 (CET) |
+ | == Reply == | ||
+ | <pre><nowiki> | ||
+ | {{#replace:{{{1}}}|/^([^{{!}}]+\{{!}}){1}([^\]]+).*/|\2}} | ||
+ | {{#replace:{{{1}}}|/^([^:]+:){1}([^{{!}}]+).*/|\2}} | ||
+ | </nowiki></pre> | ||
+ | Put the above code into a template and you will see that the user ID and the user name will be extracted. | ||
+ | ===Thank you for your help=== | ||
+ | Hi Gero. The results are just what I want. Thank you! | ||
− | + | --[[User:Roc michael|Roc michael]] 11:18, 22 December 2007 (CET) |
Latest revision as of 14:26, 31 December 2007
Description: | Asking a parser "{{#replace: [[User:Michael|Roc Michael]] | from | to }}" demo |
Extension / Version: | DPL / all |
Type / Status: | Change Request / resolved |
Problem
Hi Gero.
Could you give me the samples on using parser "replace" (or using other way) with following cases. for exapmle {{#replace: [[User:Michael|Roc Michael]] | from | to }}
Item | From (Before) | To (After) |
---|---|---|
Case 1 | [[User:Michael|Roc Michael]] and |
Roc Michael and 張小三 |
Case 2 | [[User:Michael|Roc Michael]] and |
Michael and 張三 |
Please give me a hand.--Roc michael 02:33, 20 December 2007 (CET)
Reply
{{#replace:{{{1}}}|/^([^{{!}}]+\{{!}}){1}([^\]]+).*/|\2}} {{#replace:{{{1}}}|/^([^:]+:){1}([^{{!}}]+).*/|\2}}
Put the above code into a template and you will see that the user ID and the user name will be extracted.
Thank you for your help
Hi Gero. The results are just what I want. Thank you!
--Roc michael 11:18, 22 December 2007 (CET)