79083131

Date: 2024-10-13 12:36:50
Score: 1
Natty:
Report link

Here is my simple variant of regex exspression for finding both negative and positive int and float numbers in code:

(\b|\B-)\d*(\.\d+)?

Works fine for any number variable declarations:

float x = -0.25;
int y = 123;

etc...

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Andrii Staryk