in reply to Replacing Text
And you're done. No need to get all complicated and stuff...$contents_of_file =~ s/\<a.*?\>(.*?)\<\/a\>/$1/igs;
If there are links broken across multiple lines, like$ perl -pi -e 's/\<a.*?\>(.*?)\<\/a\>/$1/igs' *.html
Those would require manual cleanup, but you can just grep for 'href' to see if there's any left. If there look like a lot, then you can bust out a script to do it.<a href="something"> foo! </a>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Replacing Text
by wfsp (Abbot) on Apr 06, 2007 at 06:08 UTC | |
by saintly (Scribe) on Apr 06, 2007 at 14:16 UTC | |
by wfsp (Abbot) on Apr 06, 2007 at 15:28 UTC |