merged in solution for highlighting, as described [here](http://stackoverflow.com/questions/18213113/regex-exec-failing-to-match-string/18235347?noredirect=1#comment26744953_18235347) by kol