escape regex characters in mentions

Usernames containing regular expression characters break formatting. Should mentions match anywhere or only at the beginning of the line?