code: function checkRegExp(test) {
    if (typeof test === 'string' && test[0] === '/') {
      var matchs = test.match(/^\/(.+)\/([igm]*)$/);
      if (matchs) {
        test = new RegExp(matchs[1], matchs[2]);
      }
    }
    return test;
  }
docs: 将字符串转换为正则
  @param {any} test
  @returns {*|RegExp}