src/Regex.php
/**
	 * Check whatever $pattern is valid regular expression pattern
	 *
	 * @param string $pattern
	 * @param array  $checkWithDelimiters
	 * @return bool
	 */
Check whatever $pattern is valid regular expression pattern
@param string $pattern
@param array  $checkWithDelimiters
@return bool
Check whatever $pattern is valid regular expression pattern @param string $pattern @param array $checkWithDelimiters @return bool
public static function isPattern(string $pattern, array $checkWithDelimiters = ['/', '#', '~']): bool
	{
		foreach ($checkWithDelimiters as $delim) {
			if (preg_match('/^\\' . $delim . '[\s\S]+\\' . $delim . '[A-Za-z]?$/', $pattern)) {
				return true;
			}
		}
		return false;
	}
public static function isPattern ( string $ pattern , array $ checkWithDelimiters = [ '/' , '#' , '~' ] ) : bool { foreach ( $ checkWithDelimiters as $ delim ) { if ( preg_match ( '/^\\' . $ delim . '[\s\S]+\\' . $ delim . '[A-Za-z]?$/' , $ pattern ) ) { return true ; } } return false ; }
Check whatever $pattern is valid regular expression pattern
 @param string $pattern
 @param array  $checkWithDelimiters
 @return bool
Check whatever $pattern is valid regular expression pattern @param string $pattern @param array $checkWithDelimiters @return bool
//see https://www.php.net/manual/en/regexp.reference.delimiters.php