Вы можете использовать чередование здесь:
^(\d{8,}|(?=[0-9.]{8,})\d+(?:\.\d+))$
Демо
Вот объяснение регулярного выражения:
^ from the start of the string
(
\d{8,} match a pure number (no decimal component) of 8 or more digits
| OR
(?=[0-9.]{8,}) assert that 8 or more digits or decimal point occurs
\d+(?:\.\d+) then match a number followed by a decimal component
)
$ end of the string