use warnings; use strict; my @f =( "Figure. 89-9","Figure 12-8","Figure 1.2"); foreach (@f) { print " $1\n" if /(\d+[-.,]\d+)/; }