while(<>) { if (/(input|textarea|select).*?name="?(.*?)"?[\s>]/gsi) { print "$2\n" } }