Escape special characters before embedding them in a regular expression.

Fixes #279
Merge pull request #287 from M2Ys4U/highlight

Escape special characters before embedding them in a regular expression.