#NEWLINE# def zshift( s ) : #NEWLINE# #INDENT# ' Returns a (string, count)-tuple, with leading zeros strippped from the string and counted.\n    ' #NEWLINE# s = s . lstrip ( ) #NEWLINE# i = 0 #NEWLINE# while s . startswith ( ( ZERO , '0' ) ) : #NEWLINE# #INDENT# s = re . sub ( ( '^(0|%s)\\s*' % ZERO ) , '' , s , 1 ) #NEWLINE# i = ( i + 1 ) #NEWLINE# #UNINDENT# return ( s , i )