Remove options and protocols in source line with regex.

Fixes #4311