I want to split the wiki template call for the parameter parts. In a very basic scenario, this is But things are complicated when the pipe is used for the character other purposes such as Wikilein Any suggestions how to do this work in a simple way? :) Update: Sorry for possibly misunderstanding but Please enter this Q & A See My answer is parsing a very similar wiki link using OK, for your case, Pearl Reggae is here: Q: Are you sure that before And now check the solution against the string | is simply broken by
{{template | Unnamed_parameter | Param1 = value1}} will be divided into
{{template ,
unnamed_parameter ,
param1 = value1 and
}} .
[[link | Title]] etc.
{{template | Unnamed_parameter | Param1 = value1}} is an example. For more information about wiki templates, you can see the following resources:
perl regex (in the update section).
Update:
echo "{{template | unnamed_parameter | param1 = value1} } "| \ Perl -pe 's # (^ | \ b) ((?! [| \ []) {{(. +?) \ | (. +?) \ | (. +?)}} (?! [ ($ | \ B) # {{$ 3, $ 4, $ 5 and}} #g 'output: {{template, anonymous_permator, absolute 1 = value1 and}}
and to close
}} otherwise just edit it above regex:
[[link | title]]
resonance "[[link | title]]". Perl - Pe's # (^ | \ b) ((?! [| \ []) {{(. +?) \ | (. +?) \ | (. +?)}} (?! [# $ { $ 3, $ 4, $ 5, and}} #G 'output: [[link | title]] #th Remains unchanged in accordance with the requirements
Comments
Post a Comment