WACT_TEMPLATE
[ class tree: WACT_TEMPLATE ] [ index: WACT_TEMPLATE ] [ all elements ]

Class: ExpressionLexerParallelRegex

Source Location: /framework/template/compiler/expressionlexer.inc.php

Class Overview


Compounded regular expression.

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

Compounded regular expression.

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


Class Variables


$_case =

Type:   mixed

$_labels =

Type:   mixed

$_patterns =

Type:   mixed

$_regex =

Type:   mixed

Class Methods


constructor ExpressionLexerParallelRegex

Constructor.

Starts with no patterns.



ExpressionLexerParallelRegex ExpressionLexerParallelRegex( boolean $case)

API Tags:

access:  public

Parameters:

boolean   $case   True for case sensitive, false for insensitive.

method addPattern

Adds a pattern with an optional label.



void addPattern( string $pattern, [string $label = true])

API Tags:

access:  public

Parameters:

string   $pattern   Perl style regex, but ( and ) lose the usual meaning.
string   $label   Label of regex to be returned on a match.

method match

Attempts to match all patterns at once against a string.



boolean match( string $subject, string &$match)

API Tags:

return:  True on success.
access:  public

Parameters:

string   $subject   String to match against.
string   $match   First matched portion of subject.

method _getCompoundedRegex

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

Caches the regex. Will automatically escape (, ) and / tokens.



void _getCompoundedRegex( array $patterns)

API Tags:

access:  private

Parameters:

array   $patterns   List of patterns in order.

method _getPerlMatchingFlags

Accessor for perl regex mode flags to use.



string _getPerlMatchingFlags( )

API Tags:

return:  Perl regex flags.
access:  private
WACT: Copyright 2003 Procata, Inc. Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html)
Documentation generated on Sun, 28 Nov 2004 19:46:28 -0800 by phpDocumentor 1.2.3