Pybot Wiki

This page describes a bit of regex. It must be used within a script or user-fix.

Getting rid of carriage returns in infoboxes
Creator: CzechOut
What it does: strips extraneous carriage returns from infoboxes
Complexity: easy

Getting rid of carriage returns in infoboxes is a bit of regex that will help you clean up your infoboxes. It looks chiefly within infoboxes (although, because it's dependent on finding an equals sign, sometimes hits around section headers) and removes instances of simple carriage returns (that is, new lines without content)

It is typically used with the script.


python -regex '\|{1}(.*?)\=(.*?)\n\s\n' '|\1=\2\n' -start:! -pt:1 


It looks for lines that start with a pipe and contain two lumps of text separated by an equals sign, and followed by an extra carriage return. Then it removes the extra carriage return.

Known limitations[]

This isn't perfect. It's not laser-focused on infoboxes, and it will sometimes harmlessly remove the carriage return around a section header. But that's all it removes. If you run it with -pt:1 (that is, one second intervals between edits), its inexactitude shouldn't add too much to your total runtime.