-2

enter image description here

I want to find the part which has a form like ( float), so I use the expression above.

But it matchew with 'b' :(0, 2074.5), which is not what i think, because it has colon. To find the part which has only one float, how can i write my regular expression in python?

Toto
  • 89,455
  • 62
  • 89
  • 125

1 Answers1

0

Kim, in this case, "." is a regular expression meaning anything. if you want to find the "." in the text, you must escape it like this \.

to find only the float in 'b' : (0, 2074.5) you should use the following Regex:

(\d+\.\d+)

Hope this will help.