rs.charAt(i)) == -1) newStr += chars.charAt(i);
            str = newStr;
          }
          str = str.replace(/[\-\.\]\"\'\\\/\^a]/g, function(orig) { return orig == "a" ? "\\w" : "\\" + orig; });
          return "[" + (invert ? "^" : "") + str + "]";
        } else if (str == "a") {
          return "\\w";
        } else if (/[?$*()+{}[\]\.|/\'\"]/.test(str)) {
          return "\\" + str;
        } else {
          return str;
        }
      }

      var newRE = "";
      for (;;) {
        var left