Wildcard Utility

Utility Class for handling wildcard opertations like "b?a_*"

class Jar\Utilities\Utilities\WildcardUtility

Jar\Utilities\Utilities\WildcardUtility::matchAgainstPatternList($patterns, $string, $flags = 0)

Matches a string against a whole list of patterns, returns "true" on first match

Parameters
Returns

Returns "true" on first match, otherwise false.


Jar\Utilities\Utilities\WildcardUtility::match($pattern, $string, $flags = 0)

Simple wildcard which matches a string against a pattern. Wildcards like * or ? are useable.

Parameters
Returns

Returns "true" on match, otherwise false.

Example:

$pattern = 'hello*world';

WildcardUtility::match($pattern, 'hello beatiful world'); // true
WildcardUtility::match($pattern, 'hello happy planet');   // false