User:SOTO/bot tricks: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
m (Bot: Automated text replacement (-replace.py +pwb.py replace, -pt:1 +pt:2, -add_text.py +pwb.py add_text))
No edit summary
Line 38: Line 38:


"\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring|featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring|featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring|featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring|featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring|featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring|featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring|featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring|featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n"-->
"\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring|featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring|featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring|featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring|featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring|featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring|featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring|featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring|featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n"-->
=== Checking for double NameSorts ===
<pre style="background:black!important;color:white">
python pwb.py replace -regex "\{\{NameSort\}\}\n([\s\S]+)\{\{NameSort\}\}" "\1{{NameSort}}" -pt:2 -transcludes:"NameSort"
</pre>


= General =
= General =
Line 43: Line 48:
<pre style="background:black!important;color:white">
<pre style="background:black!important;color:white">
python pwb.py replace -regex "\[\[(.*?) \((.*?)\)\|''\1''\]\]" "''[[\1 (\2)|\1]]''"  "\[\[(.*?)\|''\1''\]\]" "''[[\1]]''" -summary:"Piped italics fix" -pt:2 -start:!
python pwb.py replace -regex "\[\[(.*?) \((.*?)\)\|''\1''\]\]" "''[[\1 (\2)|\1]]''"  "\[\[(.*?)\|''\1''\]\]" "''[[\1]]''" -summary:"Piped italics fix" -pt:2 -start:!
</pre>
=== Empty span tags ===
<pre style="background:black!important;color:white">
python pwb.py replace -regex "(\<span\>|\</span\>|\<span class=..\>)" "" -summary:"Removing empty <span> tags" -pt:2 -start:!
</pre>
</pre>


Line 49: Line 59:
python pwb.py replace -cat:"Disambiguation pages" -regex "\*( *)''\[\[(.*?) \((.*?)\)\|\2\]\]''" "*\1[[\2 (\3)|''\2'' (\3)]]" -pt:2
python pwb.py replace -cat:"Disambiguation pages" -regex "\*( *)''\[\[(.*?) \((.*?)\)\|\2\]\]''" "*\1[[\2 (\3)|''\2'' (\3)]]" -pt:2
</pre>
</pre>


== Spacing ==
== Spacing ==

Revision as of 06:35, 7 March 2019

Categories

Adding a category to the bottom of a page

Step 1

python pwb.py add_text -cat:"category" -text:"[[Category:New category]]" -pt:2 -except:"New category"

Step 2

python pwb.py replace -cat:"New category" -regex "\[\[Category:(New category)\]\]\r\n([\s\S]*)\r\n\[\[Category:(.*?)\]\]" "\2\n[[Category:\3]]\n[[Category:\1]]" -pt:2

Absolute bottom

python pwb.py replace -cat:"New category" -regex "\[\[Category:(New category)\]\]\r\n([\s\S]*)\r\n\[\[Category:(.*?)\]\]" "\2\n[[Category:\3]]\n[[Category:\1]]" "\[\[Category:(New category)\]\]\r\n\[\[Category:(.*?)\]\]" "[[Category:\2]]\n[[Category:\1]]" -pt:2

Adding FTRW category only if contains {{wikipediainfo}}

python pwb.py replace -catr:"Example" -regex "\{\{[Ww]ikipediainfo([\s\S]*)\[\[Category:(.*?)\]\]" "{{wikipediainfo\1[[Category:\2]]\n[[Category:Example from the real world]]" -excepttext:"Example from the real world" -pt:2


Locations visited by the good Doc

pwb.py replace "-cat:Example" "-regex" "\[\[Category:Locations visited by the(.*?)Doctor\]\]" "[[Category:Example visited by the\1Doctor]]" "-pt:2"


Templates

Implementing {{w/wi}}

python pwb.py replace -regex "''\[\[(:wikipedia|wikipedia):(.*?)\|(.*?)\]\]''" "{{wi|\2|\3}}" "\[\[(:wikipedia|wikipedia):(.*?)\|(.*?)\]\]" "{{w|\2|\3}}" "\{\{(w|wi)\|(.*?)\|\2\}\}" "{{\1|\2}}" "\{\{(w|wi)\|(\w)(.*?)\|(\w)\3\}\}" "{{\1|\4\3}}" "\{\{(w|wi)\|(\w)(.*?)\|(\w)\3(s)\}\}" "{{\1|\4\3|\4\3s}}" -summary:"Converting to {{w}} and {{wi}}" -start:! -pt:2

Autolinking infobox variables

python pwb.py replace -regex "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\]" "\n|\1featuring\2=\3\4\n|\1featuring2\2=\3\5\n|\1featuring3\2=\3\6\n|\1featuring4\2=\3\7\n|\1featuring5\2=\3\8\n|\1featuring6\2=\3\9\n|\1featuring7\2=\3\10\n|\1featuring8\2=\3\11\n|\1featuring9\2=\3\12\n|\1featuring10\2=\3\13" "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\]" "\n|\1featuring\2=\3\4\n|\1featuring2\2=\3\5\n|\1featuring3\2=\3\6\n|\1featuring4\2=\3\7\n|\1featuring5\2=\3\8\n|\1featuring6\2=\3\9\n|\1featuring7\2=\3\10\n|\1featuring8\2=\3\11\n|\1featuring9\2=\3\12" "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\]" "\n|\1featuring\2=\3\4\n|\1featuring2\2=\3\5\n|\1featuring3\2=\3\6\n|\1featuring4\2=\3\7\n|\1featuring5\2=\3\8\n|\1featuring6\2=\3\9\n|\1featuring7\2=\3\10\n|\1featuring8\2=\3\11" "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\]" "\n|\1featuring\2=\3\4\n|\1featuring2\2=\3\5\n|\1featuring3\2=\3\6\n|\1featuring4\2=\3\7\n|\1featuring5\2=\3\8\n|\1featuring6\2=\3\9\n|\1featuring7\2=\3\10" "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\]" "\n|\1featuring\2=\3\4\n|\1featuring2\2=\3\5\n|\1featuring3\2=\3\6\n|\1featuring4\2=\3\7\n|\1featuring5\2=\3\8\n|\1featuring6\2=\3\9" "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\]" "\n|\1featuring\2=\3\4\n|\1featuring2\2=\3\5\n|\1featuring3\2=\3\6\n|\1featuring4\2=\3\7\n|\1featuring5\2=\3\8" "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\]" "\n|\1featuring\2=\3\4\n|\1featuring2\2=\3\5\n|\1featuring3\2=\3\6\n|\1featuring4\2=\3\7" "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\], \[\[(.*?)\]\], \[\[(.*?)\]\]" "\n|\1featuring\2=\3\4\n|\1featuring2\2=\3\5\n|\1featuring3\2=\3\6" "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\], \[\[(.*?)\]\]" "\n|\1featuring\2=\3\4\n|\1featuring2\2=\3\5" "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\]\r\n" "\n|\1featuring\2=\3\4\n" "\r\n\|( *)featuring( *)=( *)\{\{il\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\}\}" "\n|\1featuring\2=\3\4\n|\1featuring2\2=\3\5\n|\1featuring3\2=\3\6\n|\1featuring4\2=\3\7\n|\1featuring5\2=\3\8\n|\1featuring6\2=\3\9\n|\1featuring7\2=\3\10\n|\1featuring8\2=\3\11\n|\1featuring9\2=\3\12\n|\1featuring10\2=\3\13" "\r\n\|( *)featuring( *)=( *)\{\{il\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\}\}" "\n|\1featuring\2=\3\4\n|\1featuring2\2=\3\5\n|\1featuring3\2=\3\6\n|\1featuring4\2=\3\7\n|\1featuring5\2=\3\8\n|\1featuring6\2=\3\9\n|\1featuring7\2=\3\10\n|\1featuring8\2=\3\11\n|\1featuring9\2=\3\12" "\r\n\|( *)featuring( *)=( *)\{\{il\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\}\}" "\n|\1featuring\2=\3\4\n|\1featuring2\2=\3\5\n|\1featuring3\2=\3\6\n|\1featuring4\2=\3\7\n|\1featuring5\2=\3\8\n|\1featuring6\2=\3\9\n|\1featuring7\2=\3\10\n|\1featuring8\2=\3\11" "\r\n\|( *)featuring( *)=( *)\{\{il\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\}\}" "\n|\1featuring\2=\3\4\n|\1featuring2\2=\3\5\n|\1featuring3\2=\3\6\n|\1featuring4\2=\3\7\n|\1featuring5\2=\3\8\n|\1featuring6\2=\3\9\n|\1featuring7\2=\3\10" "\r\n\|( *)featuring( *)=( *)\{\{il\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\}\}" "\n|\1featuring\2=\3\4\n|\1featuring2\2=\3\5\n|\1featuring3\2=\3\6\n|\1featuring4\2=\3\7\n|\1featuring5\2=\3\8\n|\1featuring6\2=\3\9" "\r\n\|( *)featuring( *)=( *)\{\{il\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\}\}" "\n|\1featuring\2=\3\4\n|\1featuring2\2=\3\5\n|\1featuring3\2=\3\6\n|\1featuring4\2=\3\7\n|\1featuring5\2=\3\8" "\r\n\|( *)featuring( *)=( *)\{\{il\|(.*?)\|(.*?)\|(.*?)\|(.*?)\}\}" "\n|\1featuring\2=\3\4\n|\1featuring2\2=\3\5\n|\1featuring3\2=\3\6\n|\1featuring4\2=\3\7" "\r\n\|( *)featuring( *)=( *)\{\{il\|(.*?)\|(.*?)\|(.*?)\}\}" "\n|\1featuring\2=\3\4\n|\1featuring2\2=\3\5\n|\1featuring3\2=\3\6" "\r\n\|( *)featuring( *)=( *)\{\{il\|(.*?)\|(.*?)\}\}" "\n|\1featuring\2=\3\4\n|\1featuring2\2=\3\5" "\r\n\|( *)featuring( *)=( *)\{\{il\|(.*?)\}\}\r\n" "\n|\1featuring\2=\3\4\n" "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]" "\n|\1featuring\2=\3\4\n|featuring2\2=\3\5\n|featuring3\2=\3\6\n|featuring4\2=\3\7\n|featuring5\2=\3\8\n|featuring6\2=\3\9\n|featuring7\2=\3\10\n|featuring8\2=\3\11\n|featuring9\2=\3\12\n|featuring10\2=\3\13" "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]" "\n|\1featuring\2=\3\4\n|featuring2\2=\3\5\n|featuring3\2=\3\6\n|featuring4\2=\3\7\n|featuring5\2=\3\8\n|featuring6\2=\3\9\n|featuring7\2=\3\10\n|featuring8\2=\3\11\n|featuring9\2=\3\12" "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]" "\n|\1featuring\2=\3\4\n|featuring2\2=\3\5\n|featuring3\2=\3\6\n|featuring4\2=\3\7\n|featuring5\2=\3\8\n|featuring6\2=\3\9\n|featuring7\2=\3\10\n|featuring8\2=\3\11" "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]" "\n|\1featuring\2=\3\4\n|featuring2\2=\3\5\n|featuring3\2=\3\6\n|featuring4\2=\3\7\n|featuring5\2=\3\8\n|featuring6\2=\3\9\n|featuring7\2=\3\10" "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]" "\n|\1featuring\2=\3\4\n|featuring2\2=\3\5\n|featuring3\2=\3\6\n|featuring4\2=\3\7\n|featuring5\2=\3\8\n|featuring6\2=\3\9" "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]" "\n|\1featuring\2=\3\4\n|featuring2\2=\3\5\n|featuring3\2=\3\6\n|featuring4\2=\3\7\n|featuring5\2=\3\8" "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]" "\n|\1featuring\2=\3\4\n|featuring2\2=\3\5\n|featuring3\2=\3\6\n|featuring4\2=\3\7" "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]" "\n|\1featuring\2=\3\4\n|featuring2\2=\3\5\n|featuring3\2=\3\6" "\r\n\|( *)featuring( *)=( *)\[\[(.*?)\]\]\<br */*\>\[\[(.*?)\]\]" "\n|\1featuring\2=\3\4\n|featuring2\2=\3\5" "\|( *)(featuring|\1featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring|\1featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring|\1featuring.*)( *)=( *)(.*?)\|(.*?)\r\n" "|\1\2\3=\4\5\n" "\|( *)(featuring\d)   " "|\1\2  " "\|( *)(featuring\d\d)    " "|\1\2  " -transcludes:"Infobox Story" -summary:"Autolinking featuring variable" -pt:2

Checking for double NameSorts

python pwb.py replace -regex "\{\{NameSort\}\}\n([\s\S]+)\{\{NameSort\}\}" "\1{{NameSort}}" -pt:2 -transcludes:"NameSort"

General

Piped italics

python pwb.py replace -regex "\[\[(.*?) \((.*?)\)\|''\1''\]\]" "''[[\1 (\2)|\1]]''"  "\[\[(.*?)\|''\1''\]\]" "''[[\1]]''" -summary:"Piped italics fix" -pt:2 -start:!

Empty span tags

python pwb.py replace -regex "(\<span\>|\</span\>|\<span class=..\>)" "" -summary:"Removing empty <span> tags" -pt:2 -start:!

Disambig full titles

python pwb.py replace -cat:"Disambiguation pages" -regex "\*( *)''\[\[(.*?) \((.*?)\)\|\2\]\]''" "*\1[[\2 (\3)|''\2'' (\3)]]" -pt:2

Spacing

After infoboxes

Overly complicated spacing fix
python pwb.py replace -regex "\{\{Infobox([\s\S]*?)\}\}\r\n\{\{([Yy]ou may)" "{{Infobox\1}}{{you may" "\{\{Infobox([\s\S]*?)\}\}\r\n\{\{([Dd]ab page)" "{{Infobox\1}}{{dab page" "\{\{Infobox([\s\S]*?)\}\}\r\n\{\{([Ww]ikipediainfo)" "{{Infobox\1}}{{wikipediainfo" "(\}\}\{\{|\{\{)([sS]tub|.*? stub|wikipediainfo)\}\}\{\{(you may|dab page)" "\1\2}}\n{{\3" "\r\n\}\}\{\{(.*?)\}\}\{\{(you may|dab page|wikipediainfo)" "\n}}{{\1}///}{{\2" "\{\{Infobox([\s\S]*?)(\]\]|\)|\w)\}\}\{\{(you may|dab page|wikipediainfo)" "{{Infobox\1\2\n}}{{\3" "\}\/\/\/\}" "}}" "\{\{Infobox([\s\S]*?)\}\}\r\n\r\n'''" "{{Infobox\1}}\n'''" -summary:"Templates:
 [[T:SPACING|Spacing]]" -start:! -pt:2

Before headings

python pwb.py replace -regex "(\w|\)|\.|\')\r\n==" "\1\n\n==" "(\w|\)|\.|\')( *)\r\n==" "\1\n\n==" "\r\n\r\n\r\n==" "\n\n==" -excepttext:"PLEASE do not alter" -summary:"[[T:SPACING|Vertical spacing]]" -start:! -pt:2

Horizontal spacing (=/*)

This baasically does the job, though it's messy and inefficient:

python pwb.py replace -regex "\r\n(\*+)(\S)" "\n\1 \2" "(==+)(\S.*?\S)(==+)" "\1 \2 \3" "(=+|==|===|====) = (.*?) = (=+|==|===|====)" "\1= \2 =\3" "=== =" "====" "(\*+|\*\*|\*\*\*) \* (.*?)" "\1* \2" -start:! -pt:2

Videos

Good vids

Step 1: DPL search

{{#dpl:
|category=Videos
|modifiedby=SOTO
}}

Step 2

Find-and-replace list into a usable format.

python pwb.py replace "[[Category:Videos]]" "{{good video}}" -pt:2 -page:"File:Video name 1" -page:"File:Video name 2"

You may have to handle videos with double quotation marks in their titles, manually.