I have this pattern:
[0-9]*\\.?[0-9]
It matches numbers but it also matches 3.5.4 as:
How to f
Your regex is not anchored. If you want to match lines that contain only numbers and nothing else use:
^[0-9]*\.?[0-9]$