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