A basic preg_match wrapper which caches its results.
More...
Public Member Functions |
| __construct ($str) |
| match ($search, $index, &$matches) |
| Performs a search for the given pattern past the given index.
|
Private Attributes |
| $cache = array() |
| $string |
| A copy of the string to operate on.
|
Detailed Description
A basic preg_match wrapper which caches its results.
- Note
- This class is used by Scanner and should not need to be used by anything else.
A class encapsulating the process of searching for a substring efficiently it handles caching of results.
- Warning
- One instance should be used only incrementally along a string. i.e. do not call it with index = 5 then index = 1.
Member Function Documentation
LuminousStringSearch::match |
( |
|
$search, |
|
|
|
$index, |
|
|
& |
$matches |
|
) |
| |
Performs a search for the given pattern past the given index.
- Parameters
-
$search | the pattern to search for |
$index | the minimum string index (offset) of a result |
$matches | a reference to the return location of the match groups |
- Returns
- the index or false if no match is found.
Member Data Documentation
LuminousStringSearch::$cache = array() |
|
private |
The cache is stored as a map of pattern => result, the result is an array of: (0=>index, 1=>match_groups), OR, it is false if there are no more results left in the string.
The documentation for this class was generated from the following file:
- src/core/strsearch.class.php