issue #1386

* regex for matching URLs was rewritten
* added unittests