daily pastebin goal
90%
SHARE
TWEET

Brendan / fix toprettyxml()

a guest Jun 1st, 2010 881 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fix = re.compile(r'((?<=>)(\n[\t]*)(?=[^<\t]))|(?<=[^>\t])(\n[\t]*)(?=<)')
  2. fixed_output = re.sub(fix, '', input_string)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top