regex tweaks, safer webserver port selection