Is it possible to return just the captured portion of a regex using Perl’s grep function? I have code such as the following:
use LWP::Simple;
my $examples_content = get('http://example.com/javascript/reports/examples/');
my @hrefs = grep(/href="(.*)"/, split("\n", $examples_content));
print $hrefs[0];
What gets printed though is:
When I’d like just: simple_chart.html
Why are you using
grep? This might do what you want: