#!/usr/bin/env perl use warnings; use strict; use Test::More; #use re 'debug'; sub testre (_) { my $txt = shift; my @m1 = $txt =~ /<(.*?)>/sg; my @m2 = $txt =~ /<((?:(?!>).)*)>/sg; my @m3 = $txt =~ /<([^>]*)>/sg; is_deeply \@m1, \@m2, "$txt => (@m1) = (@m2)"; is_deeply \@m1, \@m3, "$txt => (@m1) = (@m3)"; } testre for ( "<", "<<", "<<<", ">", ">>", ">>>", "<<<>", "<<>", "<>", "<>>", "<>>>", "<<>>", "<<<>>>", "<><>", "<><><>", "<><<><>", "<><>><>", "ac", "a>c", "a>>c", "a<c", "a<<c", "a<>c", "a<<>>c", "ace", "aceg", "ac<fh", "ac>eg", "acgi", "ace>fh", "<\n>\n", "<\n<\n>\n>\n", "<\n>\n<\n>\n", ); done_testing;