my $content = qq~1: RTTs of replies in ms: min/avg/max: 0.093 / 0.104 / 0.128 2: RTTs of replies in ms: min/avg/max: 0.079 / 0.200 / 0.517 3: RTTs of replies in ms: min/avg/max: 0.081 / 0.090 / 0.101 4: RTTs of replies in ms: min/avg/max: 0.090 / 0.248 / 0.709 qq~; while($content =~ m!RTTs of replies in ms: min/avg/max: \d\.\d* / (\d\.\d*) / \d\.\d*!gs) { print "avg: " . $1 . "\n"; }