in reply to Untaint IP address/hostname question

(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|(?:\w+\.)+\w{2,3})
Solves the above hostname issue but misses a good few invalid values.
(\d+|(?:\d{1,3}\.){3}\d{1,3}|(?:\w+\.)+\w{2,3})
Is better but you are far better using Regex::Common functions.

Hope it helps
UnderMine