Help for this page

Select Code to Download


  1. or download this
    my $string = '<a href="page.cfm?objectid=11933900&method=full&siteid=5
    +0144"> Costly false alarms </a> <a href="page.cfm?objectid=11933890&m
    +ethod=full&siteid=50144"> Mindless yobs terrorise OAPs </a> <a href="
    +page.cfm?objectid=11933879&method=full&siteid=50144"> Road deaths </a
    +> <a href="page.cfm?objectid=11933842&method=full&siteid=50144"> Twis
    +ted porn pervert caged for life </a> <a href="page.cfm?objectid=11933
    +800&method=full&siteid=50144"> Greenbelt homes plan appeal thrown out
    + </a>';
    
    my @matches = $string =~ m!(<a[^>]*>)(.+?</a[^>]*>)!ig;
    
    print "$_\n" foreach @matches;
    
  2. or download this
    my %matches = $string =~ m!(<a[^>]*>)(.+?</a[^>]*>)!ig;
    
    ...
        print "$matches{$key}\n\n";
    
    }