libs/web: rework hostname match to not allow arbritary sequences of numbers and dots