src/Regex.php
/**
	 * Get the string matching the given pattern.
	 *
	 * @param string $pattern
	 * @param string $subject
	 * @return string
	 */
Get the string matching the given pattern.
Get the string matching the given pattern .
public static function match(string $pattern, string $subject): string
	{
		preg_match($pattern, $subject, $matches);
		if (!$matches) {
			return '';
		}
		return $matches[1] ?? $matches[0];
	}
public static function match ( string $ pattern , string $ subject ) : string { preg_match ( $ pattern , $ subject , $ matches ) ; if ( ! $ matches ) { return '' ; } return $ matches [ 1 ] ?? $ matches [ 0 ] ; }
Get the string matching the given pattern.
Get the string matching the given pattern .