#!/usr/local/bin/perl -w use strict; #matches '>' then 0 or more spaces and then #0 or more alphanumeric characters followed by '<' and 0 or more spaces while(<>){ print if m/>\s+\w*\w*\w*