Remove options and protocols in source line with regex.

Fixes #4311
Merge pull request #4347 from sashka/devel

Remove options and protocols in source line with regex.