-1

I have this snippet of a code..

(r'^-?[0-9]+(.[0-9]+)?$', 'CD')

which is obviously a regular expression. But I can't interpret its meaning?...what is it referring to?

Sebastian Proske
  • 8,255
  • 2
  • 28
  • 37
Shefali
  • 251
  • 6
  • 22

2 Answers2

0

Please use a online regex tester like https://regex101.com/ there are also explanations for the different parts of the regex.

Myonara
  • 1,197
  • 1
  • 14
  • 33
0

regex101.com is one site that explains regular expressions. You can run tests or provide examples to gain better understanding, too. Here's a link to your example: https://regex101.com/r/l53cFn/2

Steve Piercy
  • 13,693
  • 1
  • 44
  • 57