in reply to *fixed*Problem with <> and regex
G'day luxlunae,
This matches your requirements :-)
#!/usr/bin/env perl -l use strict; use warnings; my $html = '<span class="author-name" itemprop="author">Romaxton</span +>'; my $re = qr{<[^>]+>([^<]*)<[^>]+>}; print "The idea is to reduce:\n", $html; $html =~ s/$re/$1/; print "to\n", $html;
Output:
The idea is to reduce: <span class="author-name" itemprop="author">Romaxton</span> to Romaxton
-- Ken
|
|---|