'use strict';

const regexpWithFlags = /^\/((?:\\\/|[^\/])+)\/([gimy]{0,4})$/;

export default function(string) {
  try {
    let matches = regexpWithFlags.exec(string);

    if (matches) {
      let regex = matches[1];

      if (matches.length === 3 && matches[2]) {
        return new RegExp(regex, matches[2]);
      }

      return new RegExp(regex);
    }
  } catch (err) {}

  return null;
}

@@ -6,16 +6,52 @@
 strict';
+%0A/*eslint no-useless-escape: %22off%22*/
 %0A%0Aconst 

fix eslint issue