Moodle  2.2.1
http://www.collinsharper.com
ParallelRegex Class Reference

Public Member Functions

 ParallelRegex ($case)
 addPattern ($pattern, $label=true)
 match ($subject, &$match)
 _getCompoundedRegex ()
 _getPerlMatchingFlags ()
 ParallelRegex ($case)
 addPattern ($pattern, $label=true)
 match ($subject, &$match)
 _getCompoundedRegex ()
 _getPerlMatchingFlags ()

Data Fields

 $_patterns
 $_labels
 $_regex
 $_case

Detailed Description

Definition at line 35 of file lexer.php.


Member Function Documentation

Compounds the patterns into a single regular expression separated with the "or" operator. Caches the regex. Will automatically escape (, ) and / tokens.

Parameters:
array$patternsList of patterns in order. private

Definition at line 96 of file parser.php.

Here is the call graph for this function:

Compounds the patterns into a single regular expression separated with the "or" operator. Caches the regex. Will automatically escape (, ) and / tokens. private

Definition at line 102 of file lexer.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Accessor for perl regex mode flags to use.

Returns:
string Perl regex flags. private

Definition at line 114 of file parser.php.

Accessor for perl regex mode flags to use.

Returns:
string Flags as string. private

Definition at line 120 of file lexer.php.

Here is the caller graph for this function:

addPattern ( pattern,
label = true 
)

Adds a pattern with an optional label.

Parameters:
string$patternPerl style regex, but ( and ) lose the usual meaning.
string$labelLabel of regex to be returned on a match. public

Definition at line 55 of file parser.php.

addPattern ( pattern,
label = true 
)

Adds a pattern with an optional label.

Parameters:
string$patternPerl style regex, but ( and ) lose the usual meaning.
string$labelLabel of regex to be returned on a match. public

Definition at line 62 of file lexer.php.

match ( subject,
&$  match 
)

Attempts to match all patterns at once against a string.

Parameters:
string$subjectString to match against.
string$matchFirst matched portion of subject.
Returns:
boolean True on success. public

Definition at line 71 of file parser.php.

Here is the call graph for this function:

match ( subject,
&$  match 
)

Attempts to match all patterns at once against a string.

Parameters:
string$subjectString to match against.
string$matchFirst matched portion of subject.
Returns:
bool True on success. public

Definition at line 78 of file lexer.php.

Here is the call graph for this function:

ParallelRegex ( case)

Constructor. Starts with no patterns.

Parameters:
boolean$caseTrue for case sensitive, false for insensitive. public

Definition at line 40 of file parser.php.

ParallelRegex ( case)

Constructor. Starts with no patterns.

Parameters:
bool$caseTrue for case sensitive, false for insensitive. public

Definition at line 47 of file lexer.php.


Field Documentation

$_case

Definition at line 39 of file lexer.php.

$_labels

Definition at line 37 of file lexer.php.

$_patterns

Definition at line 36 of file lexer.php.

$_regex

Definition at line 38 of file lexer.php.


The documentation for this class was generated from the following files:
 All Data Structures Namespaces Files Functions Variables Enumerations