On May 25, 2013, at 15:13, Rob Lewis <[email protected]> wrote:
> Never tried any of BBEdit's fancier features. What would be the best way to
> take a file of HTML and extract just the code between the following tag
> pairs:
______________________________________________________________________
Hey Rob,
Save this as a text filter:
#! /usr/bin/env perl -0777 -n
use v5.010; use strict; use warnings;
my @array;
@array = $_ =~ m!<p itemprop="articleBody"> *(.+?) *</p>!gims;
$, = "\n";
say @array;
Run it from the menu {Text} --> {Apply Text Filter} --> {Your Text Filter}
It will alter the text of the front BBEdit document, so be sure to run on a
copy of the original is important.
The regex can be tweaked if needed.
--
Best Regards,
Chris
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].