Class ParallelRegex

Description

Compounded regular expression. Any of the contained patterns could match and when one does, it's label is returned.

Located in /php_parser.php (line 28)


	
			
Method Summary
 ParallelRegex __construct (boolean $case)
 void addPattern (string $pattern, [string $label = true])
 void getCompoundedRegex (array $patterns)
 boolean match (string $subject,  &$match, string $match)
Methods
Constructor __construct (line 40)

Constructor. Starts with no patterns.

  • access: public
ParallelRegex __construct (boolean $case)
  • boolean $case: True for case sensitive, false for insensitive.
addPattern (line 55)

Adds a pattern with an optional label.

  • access: public
void addPattern (string $pattern, [string $label = true])
  • string $pattern: Perl style regex, but ( and ) lose the usual meaning.
  • string $label: Label of regex to be returned on a match.
getCompoundedRegex (line 96)

Compounds the patterns into a single regular expression separated with the "or" operator. Caches the regex.

Will automatically escape (, ) and / tokens.

  • access: protected
void getCompoundedRegex (array $patterns)
  • array $patterns: List of patterns in order.
getPerlMatchingFlags (line 114)

Accessor for perl regex mode flags to use.

  • return: Perl regex flags.
  • access: protected
string getPerlMatchingFlags ()
match (line 71)

Attempts to match all patterns at once against a string.

  • return: True on success.
  • access: public
boolean match (string $subject,  &$match, string $match)
  • string $subject: String to match against.
  • string $match: First matched portion of subject.
  • &$match

Documentation generated on Sun, 31 Oct 2010 16:32:05 -0500 by phpDocumentor 1.4.3