0

I have a regex '[-][0-9],\s*[0-9]*(?!(km)|(Km)|(metres?)|(miles?)|(m)|(mi))'.

When I use this on regexr.com it matches '558,21' and other patterns.

but if I am using re.findall() in python

re.findall( '[-]*[0-9]*,\s*[0-9]*(?!(km)|(Km)|(metres?)|(miles?)|(m)|(mi))' , text)

it is returning me this as the output even though '558,21' is present in text variable:

[('', '', '', '', '', ''), ('', '', '', '', '', ''), ('', '', '', '', '', ''), ('', '', '', '', '', '')]

What might be the reason for it?

eyllanesc
  • 221,139
  • 17
  • 121
  • 189
Pritam Roy
  • 328
  • 2
  • 18

0 Answers0