in reply to String matching problem
#! /usr/bin/perl use warnings ; use strict; open(FH,"infile") or die "File cant be opened\n"; while (<FH>) { if (m/\d-(\d)"$/) { print "$1\n"; } } [download]
"1-2, 3-4, 5-6" or "1%5, 3-4" or "1-2" A6 12 [download]