in reply to The same pattern searching
in thread Replacing the pattern
use strict; my $target_data="</TABLE>\n\n2\n<PAGE>\n\nRISK/RETURN SUMMARY AND FUND + EXPENSES\n\n\nPRIME MONEY MARKET FUND"; my $pattern='(\n\s*[0-9]{1,3}\s*\n\s*<page>\s*\n)(.*)(\n*)'; $target_data =~ s/$pattern/" " x length($1).$2."\n" x length($3)."\n" +x length($1)/gie; print $target_data; print "\n\n";
If the "\n" looks too many then you can change my regx concatenation of the regx to minimize it</TABLE> RISK/RETURN SUMMARY AND FUND EXPENSES PRIME MONEY MARKET FUND
"\n" x length($3)."\n" x length($1)/gie;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: The same pattern searching
by agynr (Acolyte) on Jan 21, 2005 at 09:09 UTC |