Use Matt's solution for regex, add tilde to keyword chars.