Looking for a regex for the following
- Should match value before decimal place.(should return
5
if value is5.4
) - Whole number should be matched as it it (
2
in case of2
and4
in case of4
).
The numbers could be 1.2, 2.4, 2.5566, 3.555, 1, 2, 8
Regex should match 1
, 2
, 2
, 3,
1
, 2
, 8