I want to remove the padded zeroes from a string-formatted python date:
formatted_date = my_date.strftime("%m/%d/%Y") # outputs something like: 01/01/2013
date_out = formatted_date.replace(r'/0', r'/').replace(r'^0', r'')
The second replace doesnt work-- I get 01/1/2013. How do I match the zero only if it's next to the beginning of the string?