in reply to String matching problem
I hope you mean the very last digit of a line, not the last digit of '-' pattern.
Infile#! /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"; } }
"1-2, 3-4, 5-6" or "1%5, 3-4" or "1-2" A6 12
In Section
Seekers of Perl Wisdom