TYPO3  7.6
Static Public Member Functions | List of all members
Glob Class Reference

Static Public Member Functions

static toRegex ($glob, $strictLeadingDot=true, $strictWildcardSlash=true, $delimiter= '#')
 

Detailed Description

Glob matches globbing patterns against text.

if match_glob("foo.*", "foo.bar") echo "matched\n";

// prints foo.bar and foo.baz $regex = glob_to_regex("foo.*"); for (array('foo.bar', 'foo.baz', 'foo', 'bar') as $t) { if (/$regex/) echo "matched: $car\n"; }

Glob implements glob(3) style matching that can be used to match against text, rather than fetching names from a filesystem.

Based on the Perl Text::Glob module.

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com PHP port
Richard Clamp richa.nosp@m.rdc@.nosp@m.unixb.nosp@m.eard.nosp@m..net Perl version

Definition at line 36 of file Glob.php.

Member Function Documentation

static toRegex (   $glob,
  $strictLeadingDot = true,
  $strictWildcardSlash = true,
  $delimiter = '#' 
)
static

Returns a regexp which is the equivalent of the glob pattern.

Parameters
string$globThe glob pattern
bool$strictLeadingDot
bool$strictWildcardSlash
string$delimiterOptional delimiter
Returns
string regex The regexp

Definition at line 48 of file Glob.php.

References elseif.

Referenced by GlobTest\testGlobToRegexDelimiters().