JavaScript Regular Expression Tester

Enter regular expression here:

Enter the text to search against here:

Result:

Key statements:

  1. regex = eval("/(" + pattern + ")/g");
  2. replace = "$1";
  3. result = text.replace(regex, replace);