(see Riot::AssertionMacro#evaluate)
 @param [Regex, String] expected the string or regex to be used in comparison
967495
def evaluate(actual, expected)
      expected = %r[#{Regexp.escape(expected)}] if expected.kind_of?(String)
      if actual.to_s =~ expected
        pass(new_message.matches(expected))
      else
        fail(expected_message(expected).to_match(actual))
      end
    end
1326106
@Override
	public Object evaluate(Message message) throws JMSException
    {
        String leftValue = leftOperand.evaluateString(message);
        String rightValue = rightOperand.evaluateString(message);
        if (leftValue == null || rightValue == null)
            return null;
        
        String escapeValue = escapeOperand != null ? escapeOperand.evaluateString(message) : null;
        
        return StringUtils.matches(leftValue, rightValue, escapeValue);
    }
245223
def loop_eval input
    if eval_binding.kind_of?(Binding)
      eval_binding.eval(input, "(#{name})", line)
    else
      eval_binding.instance_eval(input, "(#{name})", line)
    end
  end
1121539
function equal(actual, expected, message) {
    if (actual == expected) {
      this.pass(message);
    }
    else {
      this.fail({
        actual: actual,
        expected: expected,
        message: message,
        operator: "=="
      });
    }
  }
52125
private void matches(boolean own) {
        tq.consume(own ? ":matchesOwn" : ":matches");
        String regex = tq.chompBalanced('(', ')'); // don't unescape, as regex bits will be escaped
        Validate.notEmpty(regex, ":matches(regex) query must not be empty");

        if (own)
            evals.add(new Evaluator.MatchesOwn(Pattern.compile(regex)));
        else
            evals.add(new Evaluator.Matches(Pattern.compile(regex)));
    }
533254
private void error(String expected, String actual) {
        if (!recovering) {
            recovering = true;
            final String outputString = (EOF_STRING.equals(actual) || UNTERMINATED_COMMENT_STRING.equals(actual) || COMMENT_NOT_ALLOWED.equals(actual)) ? actual : "'"
                    + actual + "'";
            errors.add(SyntaxError._UnexpectedToken(expected, outputString,
                    lookahead(1).beginLine));
        }
    }
1028423
public static void assertEquals(Object expected, Object actual) {
        assertEquals(expected, actual, "Expected value " + expected + " but got " + actual);
    }
653119
def evaluate(actual, expected)
      if actual.kind_of?(expected)
        pass new_message.is_a_kind_of(expected)
      else
        fail expected_message.kind_of(expected).not(actual.class)
      end
    end
1021185
def do_evaluate(parser, token):
  ''''''
  code = token.contents
  firstspace = code.find(' ')
  if firstspace >= 0:
    code = code[firstspace+1:]
  return Evaluator(code)
132051
function expect(value) {
        var token = lex();
        if (token.type !== Token.Punctuator || token.value !== value) {
            throwUnexpectedToken(token);
        }
    }
613795
protected final boolean matchString(int state, char expected[]) throws Exception{
        int length = expected.length;

        while(state<length && position<limit){
            if(input[position]!=expected[state])
                throw expected(codePoint(), new String(new int[]{ Character.codePointAt(expected, state) }, 0, 1));
            state++;
            position++;
        }
        if(state==length)
            return true;
        else{
            if(marker==EOF)
                throw expected(EOF, new String(expected, state, length-state));
            exiting(RULE_DYNAMIC_STRING_MATCH, state);
            return false;
        }
    }
1325186
function tokenizeEvaluate(match, value) {
    var index = tokenized.length;
    tokenized[index] = "';\n" + value + ";\n__p += '";
    return token + index;
  }
964116
def contains_text(expected_text)
      assert_exists

      case expected_text
      when Regexp
        value() =~ expected_text
      when String
        value().index(expected_text)
      else
        raise TypeError, "expected String or Regexp, got #{expected_text.inspect}:#{expected_text.class}"
      end
    end
199493
public static boolean seleniumEquals( String expectedPattern, String actual )
    {
        if ( actual.startsWith( "regexp:" ) || actual.startsWith( "regex:" ) || actual.startsWith( "regexpi:" )
            || actual.startsWith( "regexi:" ) )
        {
            // swap 'em
            String tmp = actual;
            actual = expectedPattern;
            expectedPattern = tmp;
        }
        Boolean b;
        b = equalsHandleRegex( "regexp:", expectedPattern, actual, 0 );
        if ( b != null )
        {
            return b.booleanValue();
        }
        b = equalsHandleRegex( "regex:", expectedPattern, actual, 0 );
        if ( b != null )
        {
            return b.booleanValue();
        }
        b = equalsHandleRegex( "regexpi:", expectedPattern, actual, Pattern.CASE_INSENSITIVE );
        if ( b != null )
        {
            return b.booleanValue();
        }
        b = equalsHandleRegex( "regexi:", expectedPattern, actual, Pattern.CASE_INSENSITIVE );
        if ( b != null )
        {
            return b.booleanValue();
        }

        if ( expectedPattern.startsWith( "exact:" ) )
        {
            String expectedExact = expectedPattern.replaceFirst( "exact:", "" );
            if ( !expectedExact.equals( actual ) )
            {
                // System.out.println( "expected " + actual + " to not match " + expectedPattern );
                return false;
            }
            return true;
        }

        String expectedGlob = expectedPattern.replaceFirst( "glob:", "" );
        expectedGlob = expectedGlob.replaceAll( "([\\]\\[\\\\{\\}$\\(\\)\\|\\^\\+.])", "\\\\$1" );

        expectedGlob = expectedGlob.replaceAll( "\\*", ".*" );
        expectedGlob = expectedGlob.replaceAll( "\\?", "." );
        if ( !Pattern.compile( expectedGlob, Pattern.DOTALL ).matcher( actual ).matches() )
        {
            // System.out.println( "expected \"" + actual + "\" to not match glob \"" + expectedPattern
            // + "\" (had transformed the glob into regexp \"" + expectedGlob + "\"" );
            return false;
        }
        return true;
    }
146070
function matches(regex) {
	return function(val) {
		regex.lastIndex = 0;
		return isString(val) && regex.test(val);
	};
}
875423
def expect_re(regexp, buf, pos):
    """"""
    match = regexp.match(buf, pos)
    if not match:
        return None, len(buf)
    return buf[match.start(1):match.end(1)], match.end(0)
270623
@Factory
    public static Matcher<Proc> raises(String regex) {
        return raises(IsThrowable.throwable(regex));
    }