^start of line
Positive Lookahead(?=(?:\.?\d){1,18}\.?$) Non-Capturing Group(?:\.?\d){1,18} {1,18}repeats the group contents below between 1 and 18 times:
\.?optionally matches the literal . (4610 / 568 / 2E16)
\da digit
\.?optionally matches the literal . (4610 / 568 / 2E16)
$end of line
\d*a digit, repeated any number of times
\.?optionally matches the literal . (4610 / 568 / 2E16)
\d*a digit, repeated any number of times
$end of line
g modifier: global. Finds all matches instead of stopping after the first
m modifier: multiline. Causes ^ and $ to match the start and end of each line, not only the start and end of the string