User:SOTO/bot tricks: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
Tag: sourceedit
Line 57: Line 57:
<pre style="background:black;color:white">
<pre style="background:black;color:white">
python replace.py -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:1
python replace.py -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:1
</pre>
==== Horizontal spacing (=/*) ====
This ''baasically'' does the job, though it's messy and inefficient:
<pre style="background:black;color:white">
python replace.py -regex "\r\n(\*+)(\S)" "\n\1 \2" "(==+)(\S.*?\S)(==+)" "\1 \2 \3" "(=+|==|===|====) = (.*?) = (=+|==|===|====)" "\1= \2 =\3" "=== =" "====" "(\*+|\*\*|\*\*\*) \* (.*?)" "\1* \2" -start:! -pt:1
</pre>
</pre>


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