in reply to regular Expression

See perlre (Capture buffers).
use warnings; use strict; while (<DATA>) { if (/ ^ (\d+) [.] (\d+) [.] (\d+) $ /x) { print "$1 $2 $3\n"; } } __DATA__ 7.55.3 12.0.2
Prints:
7 55 3 12 0 2

Update: I noticed your update, and maybe you want to restrict it to 1- or 2-digit only:

if (/ ^ (\d{1,2}) [.] (\d{1,2}) [.] (\d{1,2}) $ /x) {