User:SOTO/bot tricks: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
Line 12: Line 12:
<pre style="background:black!important;color:white">
<pre style="background:black!important;color:white">
python pwb.py replace -cat:"New category" -regex "\[\[Category:(New category)\]\]\n([\s\S]*)\n\[\[Category:(.*?)\]\]" "\2\n[[Category:\3]]\n[[Category:\1]]" "\[\[Category:(New category)\]\]\n\[\[Category:(.*?)\]\]" "[[Category:\2]]\n[[Category:\1]]" -pt:2
python pwb.py replace -cat:"New category" -regex "\[\[Category:(New category)\]\]\n([\s\S]*)\n\[\[Category:(.*?)\]\]" "\2\n[[Category:\3]]\n[[Category:\1]]" "\[\[Category:(New category)\]\]\n\[\[Category:(.*?)\]\]" "[[Category:\2]]\n[[Category:\1]]" -pt:2
</pre>
=== Bringing a category to no.1 position ===
<pre style="background:black!important;color:white">
python pwb.py replace -cat:"Target category" -regex "\[\[Category:(.*?)\]\]\n*([\s\S]*)\n\[\[Category:(Target category)\]\]" "[[Category:\3]]\n[[Category:\1]]\n\2" "\[\[Category:(.*?)\]\]\n\[\[Category:(Target category)\]\]" "[[Category:\2]]\n[[Category:\1]]" -pt:2
</pre>
</pre>


Cookies help us deliver our services. By using our services, you agree to our use of cookies.