Working With Regular Expressions in JavaScript
The most common way to define a regexp pattern is to define a variable instance with a pattern you want to match, along with any modifiers you wish to use.

The most common way to define a regexp pattern is to define a variable instance with a pattern you want to match, along with any modifiers you wish to use.