Simplify regular expressions in compile.js

Meta-character `\w` already contains a `\d` and `_`.