my $open = qr{ < [a-zA-Z][a-zA-Z0-9]* (?: \s+ \w+ (?: \s* = \s* (?: "[^"]*" | '[^']*' | [^\s>]* ) )? )* \s* > }x; #### my $close = qr{ < / \s* [a-zA-Z][a-zA-Z0-9]* \s* > }x; #### # the following are comments: # #