Here you can find the source of assertMatches(String name, String regExp, String actual)
public static void assertMatches(String name, String regExp, String actual)
//package com.java2s; //License from project: Apache License public class Main { public static void assertMatches(String name, String regExp, String actual) { if (notMatches(regExp, actual)) { throw new AssertionError(name + ": " + actual + " is not matching " + regExp + "!"); }// ww w . ja v a 2 s . c o m } public static boolean notMatches(String regularExpression, String text) { if (text == null || regularExpression == null) { return true; } return !text.matches(regularExpression); } public static boolean matches(String regularExpression, String text) { if (text == null || regularExpression == null) { return false; } return text.matches(regularExpression); } }