/ character. However, if you would like to use the global object
RegExp, then you would need to pass in a string as the first argument to the constructor using the normal string escape rules. The following are equivalent.
// shorthand way. var re = /\w+/; // a way to pass a string in var re = new RegExp("\\w+");