Author of:
Secrets of the JavaScript Ninja, 1st and 2nd editions,
jQuery in Action, 1st, 2nd and 3rd editions,
Ajax in Practice, and
Prototype and Scriptaculous in Action
1. When using regular expressions, it's best to use RE literals versus strings when you can. That way you get syntax checking, and avoid string escaping woes.