Hi,
try the matching modifier s.
#!/usr/bin/perl use strict; use warnings; my $string = <<EOF; ----------------------------------------------------------- ISSUE ABCDE00078945 ----------------------------------------------------------- Summary : summary about the issue Component : Component desscription Product : Product name Version : Version number Date : 2013-10-15 ----------------------------------------------------------- ISSUE ABCDE00012345 ----------------------------------------------------------- Summary : summary about the issue Component : Component description Product : Product name Version : Version number Date : 2014-10-15 The above pattern will be containing special characters. Each set of "ISSUE" i e., ----------------------------------------------------------- ISSUE ABCDE00078945 ----------------------------------------------------------- Summary : summary about the issue Component : Component desscription Product : Product name Version : Version number Date : 2013-10-15 EOF while($string =~ /(ISSUE\s+\w{5}\d+)\n-*\n\s*([\S\s]*?)---*/gs) { print "$1\n"; }
Regards
McA
In reply to Re: matching characters
by McA
in thread matching characters
by shylaja
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |