FANDOM


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

Regex-button
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 replace.py script.

Code Edit

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

Explanation Edit

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 Edit

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.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.