negative lookahead ~rule
507241
function _not(expr) {
      var state = this.bt.current_state();
      try { var r = expr.call(this) } 
      catch (f) {
        this.bt.catch_mismatch(f);
        this.bt.restore(state);
        return true
      }
      this.bt.mismatch("Negative lookahead didn't match got " + r);
    }
1341021
def _find_prev regex=@last_regex, start = @search_found_ix, first_time = false
      #TODO the firsttime part, see find_next
      #raise "No previous search" if regex.nil?
      warn "No previous search" and return if regex.nil?
      #$log.debug " _find_prev #{@search_found_ix} : #{@current_index}"
      if start != 0
        start -= 1 unless start == 0
        @last_regex = regex
        @search_start_ix = start
        regex = Regexp.new(regex, Regexp::IGNORECASE) if @search_case
        start.downto(0) do |ix| 
          row = @list[ix].to_s
          m=row.match(regex)
          if !m.nil?
            @find_offset = m.offset(0)[0]
            @find_offset1 = m.offset(0)[1]
            ix += (@_header_adjustment || 0)
            @search_found_ix = ix
            return ix 
          end
        end
      end
      fend = start-1
      start = @list.size-1
      if @search_wrap
        start.downto(fend) do |ix| 
          row = @list[ix].to_s
          m=row.match(regex)
          if !m.nil?
            @find_offset = m.offset(0)[0]
            @find_offset1 = m.offset(0)[1]
            ix += (@_header_adjustment || 0)
            @search_found_ix = ix
            return ix 
          end
        end
      end
      return nil
    end
20394
static String stripRules(String rules) {
        StringBuilder strippedRules = new StringBuilder();
        int rulesLength = rules.length();
        for (int idx = 0; idx < rulesLength;) {
            char ch = rules.charAt(idx++);
            if (ch == '#') {
                while (idx < rulesLength
                        && ch != '\r' && ch != '\n' && ch != chNEL) {
                    ch = rules.charAt(idx++);
                }
            }
            if (!UCharacter.isISOControl(ch)) {
                strippedRules.append(ch);
            }
        }
        return strippedRules.toString();
    }
1052981
function indexOf(match) {
        var i = matches.length;
        while (i--) {
          if (matches[i] === match) {
            return i;
          }
        }

        return -1;
      }
221209
function parse_rule() {
		$rule = trim( $this->rule ) ;

		/* If this is a regex end-token, just mark it and return */
		if ( substr( $rule, 0, 1 ) == '/' ) {
			$this->parsed = new TokenRegex( $rule ) ;
		}
		else {
			$tokens = array() ;
			$this->tokenize( $rule, $tokens ) ;
			$this->parsed = ( count( $tokens ) == 1 ? array_pop( $tokens ) : new TokenSequence( $tokens ) ) ;
		}
		
	}
713856
function boolMatch(s, matchers) {
    var i, matcher, down = s.toLowerCase();
    matchers = [].concat(matchers);
    for (i = 0; i < matchers.length; i += 1) {
      matcher = matchers[i];
      if (!matcher) continue;
      if (matcher.test && matcher.test(s)) return true;
      if (matcher.toLowerCase() === down) return true;
    }
  }
946798
def accepts(regex, negate, *values):
    
    return any(v and regex.search(v) for v in values) != negate
73072
function isEqualRegexp(a, b) {
  if (typeOf(a) !== 'regexp') return false;
  if (typeOf(b) !== 'regexp') return false;
  if (a.source !== b.source) return false;
  if (a.global !== b.global) return false;
  if (a.multiline !== b.multiline) return false;
  if (a.ignoreCase !== b.ignoreCase) return false;
  return true;
}
986350
public int findIn(Source source) {
        if (regex != null) {
            Matcher matcher = regex.matcher(source.subToEnd());
            if (matcher.find()) {
                return source.getOffset() + matcher.start();
            } else {
                return -1;
            }
        } else {
            return -1;
        }
    }
249936
function precedenceAdjustmentSpecification(word){
    var regex_rules = [
        /^be(.*)lah$/,
        /^be(.*)an$/,
        /^me(.*)i$/,
        /^di(.*)i$/,
        /^pe(.*)i$/,
        /^ter(.*)i$/,
    ];

    for(var i in regex_rules){
        if(word.match(regex_rules[i])){
            return true;
        }
    }
    return false;
}
591755
def and_next(e):
    
    def match_and_next(s, grm=None, pos=0):
        try:
            e(s, grm, pos)
        except PegreError as ex:
            raise PegreError('Positive lookahead failed', pos)
        else:
            return PegreResult(s, Ignore, (pos, pos))
    return match_and_next
716828
def _MatchDirective(token):
    """"""
    # Tokens below must start with '.'
    if token.startswith('.'):
        token = token[1:]
    else:
        return None, None
    
    if token == 'end':
        return END_TOKEN, None
    
    if token == 'alternates with':
        return ALTERNATES_TOKEN, token
    
    if token.startswith('or'):
        if token.strip() == 'or':
            return OR_TOKEN, None
        else:
            pred_str = token[2:].strip()
            return OR_TOKEN, pred_str
    
    match = _SECTION_RE.match(token)
    if match:
        repeated, section_name = match.groups()
        if repeated:
            return REPEATED_SECTION_TOKEN, section_name
        else:
            return SECTION_TOKEN, section_name
    
    if token.startswith('template '):
        return SUBST_TEMPLATE_TOKEN, token[9:].strip()
    if token.startswith('define '):
        return DEF_TOKEN, token[7:].strip()
    
    if token.startswith('if '):
        return IF_TOKEN, token[3:].strip()
    if token.endswith('?'):
        return PREDICATE_TOKEN, token
    
    return None, None
776641
def _get_span(s, pattern):
    """"""
    i, j = -1, -1

    match = pattern.match(s)
    if not match:
        return i, j

    for group_name in pattern.groupindex:
        i, j = match.span(group_name)
        if (i, j) != (-1, -1):
            return i, j

    return i, j
301068
function matches (path) {
      if (type(ignores) === TYPES.STRING) {
        return path.search(ignores) > -1;
      } else if (type(ignores) === TYPES.REGEXP) {
        return ignores.test(path);
      } else {
        return ignores.some(function (ignore) {
          return type(ignore) === TYPES.STRING ? (path.search(ignore) > -1) : ignore.test(path);
        });
      }
    }
500179
function isMatchRule(req, pathname, rule) {
  if (typeof rule === 'string') {
    return pathname.indexOf(rule) > -1;
  } else if (rule instanceof RegExp) {
    return rule.test(pathname);
  } else if (typeof rule === 'function') {
    return rule(pathname, req);
  }
}
847628
function(match, value, len) {
			var num = '' + value;
			if (lookAhead(match))
				while (num.length < len)
					num = '0' + num;
			return num;
		}
1196371
function lookahead (n) {
    let counter = current
    const target = current + n
    let res = ''
    while (counter < target) {
      res += input[++counter]
    }
    return res
  }