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