Regular Expression Modifiers :
/g enables "global" matching. With the replace() method, specify this modifier to replace all matches.
/i makes the RegExp match case insensitive.
/s enables "single-line mode". In this mode, the dot matches newlines.
/m enables "multi-line mode". In this mode, the caret and dollar match before and after newlines in the subject string.
You can combine multiple modifiers as the following [/mysearch/gi].
Write your regular expression :
myRegExp =
new RegExp(string, modifiers)
ex : myRegExp = new RegExp("dollar","gi")