How to parse from a string the numbers and punctuation in Python : <p>I want to turn a string like "$1,234.56" into 1234.56 so I can add it to a database, my current solution is using <code>re.sub("[^0-9]", "", str1</code> this however strips the punctuation too, is there a way to keep it?</p>

<p>I'm using python 3.6.5</p>
