Improved RegExp syntax rules