Please I am trying to get a code in python that can look through a string like this one “986.80 CCF X $5.89 $5812.25” and return only the floating point number after the second “$” character. In this case it should return 5812.25
Here is the code I tried but it still returns the numbers after the first “$” character
match = re.search(r’$([d.]+)$’, extracted_strg)
if match:
return float(match.group(1))
else:
return None
Kevin Ebinum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1