Hi All,
I want to find the string which are having the date inside the file. Please help me how do I match it,below is my program and it's not returning anything. #!/usr/bin/perl open(DATA,"i")||die "Unable to open the file"; while(<DATA>) { if($_=~/(\d{2})([\W])\1\2\1]/) { print $_; } } close(DATA); exit 0; ~ Input file: $cat i 15-06-79 05-06-1981 12-11-9 13-10-89 19-10-20009 1-10-0002 02-03-2008 03-nov-2008 $ Output should be:- 15-06-79 05-06-1981 13-10-89 02-03-2008 03-nov-2008 DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. -----------------------------------------------------------------------------------------------------------------------