Properly escaped digit(), tab(), whitespace() so they work (again).
Changed escaping method to regex for performance.