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
  • 235,170
  • 19
  • 170
  • 241
Ab1gor
  • 398
  • 3
  • 19

0 Answers0