in reply to regular Expression
Prints:use warnings; use strict; while (<DATA>) { if (/ ^ (\d+) [.] (\d+) [.] (\d+) $ /x) { print "$1 $2 $3\n"; } } __DATA__ 7.55.3 12.0.2
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) {
|
|---|