Class ParallelRegex

Description

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

Located in /parser.php (line 28)


	
			
Variable Summary
 mixed $_case
 mixed $_labels
 mixed $_patterns
 mixed $_regex
Method Summary
 ParallelRegex ParallelRegex (boolean $case)
 void addPattern (string $pattern, [string $label = true])
 boolean match (string $subject,  &$match, string $match)
Variables
mixed $_case (line 32)
mixed $_labels (line 30)
mixed $_patterns (line 29)
mixed $_regex (line 31)
Methods
Constructor ParallelRegex (line 40)

Constructor. Starts with no patterns.

  • access: public
ParallelRegex ParallelRegex (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.
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, 04 May 2008 09:21:55 -0500 by phpDocumentor 1.3.0