if ($chapter =~ /^([\d.]+\.)\d+$/) { print "$1 is prior to $chapter.\n"; }