use strict; use warnings; my $inData = <<INDATA; int abc; .abc(abc); INDATA open my $in_fh1, '<', \$inData; while (my $line = <$in_fh1>) { # if ($line =~ if( my ($intro) = $line =~ /([.(]?abc)/g){ print "${intro}_$_;\n" for 1 .. 2; } } close $in_fh1;
My output should be
int abc_1;
int abc_2;
.abc_1(abc_1);
.abc_2(abc_2);
But it is coming
abc_1;
abc_2;
.abc_1;
.abc_2;
In reply to Re^4: Please correct me in the above regular expression
by suvendra123
in thread Please correct me in the above regular expression
by suvendra123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |