bbusschots-mu/mu-qunit-util · index.es.js
javascript logo
function regexpCheck(regexp, regexes) {
        is[regexp] = function(value) {
            return regexes[regexp].test(value);
        };
    }
Similar code snippets
1.
savfx/savjs · checks.js
Match rating: 68.48% · See similar code snippets
javascript logo
function re (value, [, regexp]) {
  if (typeof regexp === 'string') {
    if (!regexpMaps[regexp]) {
      regexpMaps[regexp] = toRegExp(regexp)
    }
  }
  let ref = (regexpMaps[regexp] || regexp)
  return ref.test(value)
}
2.
avwo/whistle · util.js
Match rating: 68.47% · See similar code snippets
javascript logo
function(regExp) {
  if (!regExp) {
    return;
  }
  regExp = REG_EXP.test(regExp);
  try {
    regExp = regExp && new RegExp(RegExp.$1, RegExp.$2);
  } catch(e) {
    return;
  }
  return regExp;
}
3.
assaf/node-replay · catalog.js
Match rating: 68.13% · See similar code snippets
javascript logo
function match(name, regexps){
  for (let regexp of regexps)
    if (regexp.test(name))
      return true;
  return false;
}
4.
jochen-schweizer/express-prom-bundle · index.js
Match rating: 67.47% · See similar code snippets
javascript logo
function matchVsRegExps(element, regexps) {
  for (const regexp of regexps) {
    if (regexp instanceof RegExp) {
      if (element.match(regexp)) {
        return true;
      }
    } else if (element === regexp) {
      return true;
    }
  }
  return false;
}
5.
avwo/whistle · index.js
Match rating: 66.75% · See similar code snippets
javascript logo
function toRegExp(regExp, ignoreCase) {
  regExp = REG_EXP_RE.test(regExp);
  try {
    regExp = regExp && new RegExp(RegExp.$1, ignoreCase ? 'i' : RegExp.$2);
  } catch(e) {
    regExp = null;
  }
  return regExp;
}
6.
janus-toendering/options-parser · types.js
Match rating: 65.5% · See similar code snippets
javascript logo
function(msg, regexp)
{
	if(!util.isRegExp(regexp))
		regexp = new RegExp(regexp);
	
	msg = msg || "Invalid value";
	return function(value, replace)
	{
		return regexp.test(value) || msg;
	}
}
7.
idanwe/meteor-client-side · meteor-client-side.bundle.min.js
Match rating: 65.5% · See similar code snippets
javascript logo
function convertRegexpToMongoSelector(regexp){check(regexp,RegExp);var selector={$regex:regexp.source};var regexOptions="";if(regexp.ignoreCase)regexOptions+="i";if(regexp.multiline)regexOptions+="m";if(regexOptions)selector.$options=regexOptions;return selector}
8.
Semantic-Org/Semantic-UI-CSS · semantic.js
Match rating: 65.01% · See similar code snippets
javascript logo
function(value, regExp) {
      if(regExp instanceof RegExp) {
        return value.match(regExp);
      }
      var
        regExpParts = regExp.match($.fn.form.settings.regExp.flags),
        flags
      ;
      // regular expression specified as /baz/gi (flags)
      if(regExpParts) {
        regExp = (regExpParts.length >= 2)
          ? regExpParts[1]
          : regExp
        ;
        flags = (regExpParts.length >= 3)
          ? regExpParts[2]
          : ''
        ;
      }
      return value.match( new RegExp(regExp, flags) );
    }
9.
osdat/jsdataframe · jsdataframe.js
Match rating: 63.79% · See similar code snippets
javascript logo
function elemRegexTest(str, regexp) {
  if (regexp === null || str === null) {
    return null;
  }
  return regexp.test(str);
}
10.
topaxi/postcss-selector-namespace · plugin.js
Match rating: 63.46% · See similar code snippets
javascript logo
function regexpToGlobalRegexp(regexp) {
  let source = regexp instanceof RegExp ? regexp.source : regexp

  return new RegExp(source, 'g')
}