2008/11/22 Sureshkumar M (HCL Financial Services) <[EMAIL PROTECTED]>: > > Hi All,
Hi > > #!/usr/bin/perl # Always use these, particularly when things aren't working as expected. use strict; use warnings; > open(DATA,"i")||die "Unable to open the file"; > > while(<DATA>) > > { > > if($_=~/(\d{2})([\W])\1\2\1]/) I could be wrong but I don't think \w will not match a hypen "-" so the test will fail. This works for me: if ($_=~/\d{1,2}-(\d{2}|\w{3})-\d+/) HTH, Dp. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/