MODULES Uize.Str.Search
1. Introduction
The Uize.Str.Search
package lets you search for all occurrences of a match in a multi-line string, providing information such as start and end line number and character position for each of the search results.
DEVELOPERS: Chris van Rensburg
1.1. Examples
There are no dedicated showcase example pages for the Uize.Str.Search
module.
SEARCH FOR EXAMPLES
Use the link below to search for example pages on the UIZE Web site that reference the Uize.Str.Search
module...
SEARCH
1.2. Implementation Info
The Uize.Str.Search
module defines the Uize.Str.Search
package under the Uize.Str
namespace.
1.2.1. Features Introduced in This Module
The features listed in this section have been introduced in this module.
STATIC METHODS
Uize.Str.Search.getLineAndChar
| Uize.Str.Search.search
STATIC PROPERTIES
Uize.Str.Search.moduleName
| Uize.Str.Search.pathToResources
1.2.2. Features Overridden in This Module
No features have been overridden in this module.
1.2.3. Features Inherited From Other Modules
This module has no inherited features.
1.2.4. Modules Directly Under This Namespace
There are no modules directly under this namespace.
1.2.5. Unit Tests
There is no dedicated unit tests module for the Uize.Str.Search
module.
2. Static Methods
2.1. Uize.Str.Search.getLineAndChar
IMPLEMENTATION INFO
this feature was introduced in this module |
2.2. Uize.Str.Search.search
Returns an array, containing search result array objects for the zero or more matches of the specified matcher regular expression.
SYNTAX
searchResultsARRAY = Uize.Str.Search.search (sourceSTR,matcherREGEXP);
The Uize.Str.Search.search
method always returns an array, regardless of whether or not there are matches. When the search produces no results, the returned array will be empty.
2.2.1. Result Objects
Each element of the returned search results array is a match array, containing elements for all the captures of the match along with the following additional custom properties...
start - a character position object, describing the start position of the match segment within the source string |
|
end - a character position object, describing the end position of the match segment within the source string |
2.2.1.1. Character Position Object
A character position object is an object that describes a character position within a string in terms of line number, line character position, and absolute character position.
STRUCTURE
{ line:lineINT, // the line number within the string lineChar:lineCharINT, // the character position within the line char:charINT // the absolute character position within the string }
IMPLEMENTATION INFO
this feature was introduced in this module |