Adjust some regular expressions

* Match beginning of string instead of beginning of line.
* Escape literal periods.