I'm dealing with a regex in Java that should capture all occurrences of decimal numbers with no leading zeros.
Example:
The cat is .75 high but the dog id 3.67 high instead. All animals aren't higher that .87.
I expect to capture only .75 and .87 as they are decimals with whatever numbers of digits, but without the leading zero. I should not capture 3.67 instead.
I tried capturing it with word boundaries on both sides:
\b\.\d+\b
But the word boundary on the left side of this doesn't work well. Without the word boundary, it matches 3.67 too.
What would be the correct regex syntax to achieve this requirement?