Allow dashes in classnames

Uses (^|\s) and (\s|$) instead of \b in regular expressions. Thus, "b" is not matched in "a-b-c".