Checks that string not match with pattern

@param string $pattern
@param string $string
@param string $message
435561
protected function assertNotRegExp($pattern, $string, $message = '')
    {
        \PHPUnit\Framework\Assert::assertNotRegExp($pattern, $string, $message);
    }
125357
public function contains($pattern, $regexp = FALSE)
  {
    if(empty($pattern))
    {
      return TRUE;
    }

    if($regexp)
    {
      return (preg_match("/" . $pattern . "/i", $this->string)) ? TRUE : FALSE;
    }
    else
    {
      return (stristr($this->string, $pattern) !== FALSE) ? TRUE : FALSE;
    }
  }
294093
public function matches($pattern): bool
    {
        Assert::typeOf(['string', __CLASS__], $pattern);

        return preg_match((string) $pattern, $this->data) === 1;
    }
894569
protected function _matchPattern($patterns, $body) {
		foreach ($patterns as $pattern) {
			if (preg_match(String::insert($pattern, $this->_regexMap), $body) === 1) {
				return true;
			}
		}
		return false;
	}
453777
protected function assertNotContains($needle, $haystack, $message = '')
    {
        \PHPUnit\Framework\Assert::assertNotContains($needle, $haystack, $message);
    }
593562
public function fnmatch($pattern, $string)
    {
        if (!function_exists('fnmatch')) {
            return preg_match(
                "#^" . strtr(
                    preg_quote($pattern, '#'),
                    array('\*' => '.*', '\?' => '.', '\[' => '[', '\]' => ']')) . "$#i",
                $string);
        } else {
            return fnmatch($pattern, $string);
        }
    }
859856
private function matches($pattern, $subject)
    {
        if (preg_match($pattern, $subject, $matches)) {
            $args = array();

            foreach ($matches as $key => $value) {
                if (!is_int($key)) {
                    $args[$key] = $value;
                }
            }

            return $args;
        }

        return false;
    }
246116
public function shouldMessageCaptureBeSkipped(string $message): bool
    {
        if (function_exists('fnmatch')) {
            foreach ($this->skipWildcard as $wildcard) {
                if (fnmatch($wildcard, $message)) {
                    return true;
                }
            }
        }
        if (in_array($message, $this->skipCapture, true)) {
            return true;
        }

        if (in_array($message, $this->skipCommand, true)) {
            return true;
        }
        return false;
    }
609331
protected function assertStringStartsWith($prefix, $string, $message = '')
    {
        \PHPUnit\Framework\Assert::assertStringStartsWith($prefix, $string, $message);
    }
1136143
public function isMatch(
        $regexPattern,
        array $regexModifierList,
        $string
    ) {
        foreach ($regexModifierList as $regexModifier) {
            $this->validateRegexModifier($regexModifier);
        }

        $result = preg_match('/' . $regexPattern . '/' . implode('', $regexModifierList), $string);

        if ($result === false) {
            throw new RegexErrorException('Regex error');
        }

        if (preg_last_error() !== PREG_NO_ERROR) {
            throw new RegexErrorException(
                sprintf(
                    'Regex error (error: "%s")',
                    $this->errorMap[preg_last_error()]
                )
            );
        }

        return $result === 1 ? true : false;
    }
902131
public CharSequence matchesPattern(final CharSequence input, final String pattern, final String message) {
        if (!Pattern.matches(pattern, input)) {
            fail(message);
        }
        return input;
    }
1374228
public static function assumeOperatingSystem($pattern, $message = ''): void
    {
        $regEx = sprintf('/%s/i', addcslashes($pattern, '/'));
        assumeThat(PHP_OS, matchesPattern($regEx), $message);
    }
433624
private static function isValidRegex($pattern)
    {
        try {
            return preg_match(sprintf('~%s~', $pattern), null) !== false;
        } catch (\Exception $e) {
            return false;
        }
    }
722884
private function IsValidFormat($Name, $Pattern, $Value)
        {
            if (! empty($Value)) {
                if (! preg_match($Pattern, $Value)) {
                    throw new Exception('Invalid '.$Name.'.');
                }
            }
        }
933804
public void setRegExp(final String pattern,
                          final String invalidCharactersInNameErrorMessage,
                          final String invalidCharacterTypedMessage) {
        regExp = RegExp.compile(pattern);
        this.invalidCharactersInNameErrorMessage = invalidCharactersInNameErrorMessage;
        this.invalidCharacterTypedMessage = invalidCharacterTypedMessage;
    }
636215
public static function matchPattern(string $pattern, string $fileName): bool
    {
        $replaceMap = [
            '*' => '.*',
            '.' => '\.',
            '+' => '.+',
            '/' => '\/',
        ];

        $pattern = str_replace(array_keys($replaceMap), array_values($replaceMap), $pattern);
        $pattern = '/' . $pattern . '/i';

        if (preg_match($pattern, $fileName)) {
            return true;
        }

        return false;
    }
1088835
public function notMatch($pattern) {
        if (!$this->_isValid) {
            return $this;
        }
        if (preg_match($pattern, $this->_unsafeVar)) {
            $this->_isValid = false;
        }
        return $this;
    }