Regular Expression Search or Replace

If the global option is selected for search and replace then every occurrence of the pattern is replaced by the replacement string. Otherwise only the first occurrence is replaced.

If the case insensitive option is selected then a case insensitive search is done. For example the patterns Fred and FRED are equivalent.

pattern:
String to search:
Replacement string:
global:
case insensitive:

Result of exec (search) or replace methods:
Result of test method: