Adjust regexp and protocol matching.