Adjust some regular expressions

* Match beginning of string instead of beginning of line.
* Escape literal periods.
Merge pull request #140 from blom/adjust-regexp

Adjust some regular expressions