If this isn't a one off I'd really look into HTML::PARSER . It makes retrieving tag attributes quite simple. And it's designed to do this job. Of course it could be overkill, but I tend to think the Module use makes for more readable code than regex abuse.
no, actually this particular project required quite an elegant regex. i ended up not mixing together regexes for both input and select tags, but I wrote routines for select tags to run separately. so far so good. thank you for all suggestions!