jlistf, I can't (and won't) disagree that the regexp optimizations you've offered
do optimize the search. But this is really the kind of data that should not be optimized. Since ports can change, new scanners can come (and go), etc, optimizing the regexp seriously decreases the maintainability of the script. The next person that comes along may not be a Perl programmer.
To this end, the script should contain an array at the top, with the list of port numbers, along with explicit instructions as to how to add/delete/change a port number. The next person shouldn't have to learn regexp just to update the ports to be checked for.
So, you get a virtual ++ for reducing the regexp, but a virtual -- for making it more unmaintainable. (which really means I just don't vote on the node).
--Chris
e-mail jcwren