[ Index ] |
PHP Cross Reference of DokuWiki |
[Source view] [Print] [Project Stats]
Lexer adapted from Simple Test: http://sourceforge.net/projects/simpletest/ For an intro to the Lexer see: https://web.archive.org/web/20120125041816/http://www.phppatterns.com/docs/develop/simple_test_lexer_notes
Author: | Marcus Baker http://www.lastcraft.com |
File Size: | 203 lines (7 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
ParallelRegex:: (6 methods):
__construct()
addPattern()
apply()
split()
getCompoundedRegex()
getPerlMatchingFlags()
Class: ParallelRegex - X-Ref
Compounded regular expression.__construct($case) X-Ref |
Constructor. Starts with no patterns. param: boolean $case True for case sensitive, false |
addPattern($pattern, $label = true) X-Ref |
Adds a pattern with an optional label. param: mixed $pattern Perl style regex. Must be UTF-8 param: bool|string $label Label of regex to be returned |
apply($subject, &$match) X-Ref |
Attempts to match all patterns at once against a string. param: string $subject String to match against. param: string $match First matched portion of return: bool|string False if no match found, label if label exists, true if not |
split($subject, &$split) X-Ref |
Attempts to split the string against all patterns at once author: Christopher Smith <chris@jalakai.co.uk> param: string $subject String to match against. param: array $split The split result: array containing, pre-match, match & post-match strings return: boolean True on success. |
getCompoundedRegex() X-Ref |
Compounds the patterns into a single regular expression separated with the "or" operator. Caches the regex. Will automatically escape (, ) and / tokens. return: null|string |
getPerlMatchingFlags() X-Ref |
Accessor for perl regex mode flags to use. return: string Perl regex flags. |