Help for this page

Select Code to Download


  1. or download this
    use strict;
    my $input='
    ...
    
    my @arr=$input=~m#&lt;[^<>]+(?:<a>.+?</a>[^<>]*)?>#g;
    print join "\n",@arr;
    
  2. or download this
    qr {&lt;(?:[^<>]+|<a>|</a>)*>}
    
  3. or download this
    qr {&lt;(?:[^<>]+|<a>|</a>)*[^>]*>}
    
  4. or download this
    my $re;
    $re=qr{(?:[^<>]+|<a>(??{$re})?</a>)*};
    my @arr=$input=~m#&lt;$re>#g;