in reply to pattern match
You have mentioned that you want to match only complex.12 and not complex.120, so you can try this.
You have not clearly mentioned that whether the number of digits vary, so you can try this
undef $/;
$file2 = <FILE>;if ($file2 =~ /complex\.\d{2}/) { $pre = $` $line = ($pre =~ s/\n/\n/g); print "$line"; }
Prasad
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: pattern match
by davido (Cardinal) on Oct 26, 2004 at 15:37 UTC | |
by prasadbabu (Prior) on Oct 26, 2004 at 16:24 UTC |