Platforms to show: All Mac Windows Linux Cross-Platform
Back to PCRE2MatchDataMBS class.
PCRE2MatchDataMBS.Constructor(code as PCRE2CodeMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Regular Expressions | MBS RegEx Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The first argument points to a compiled pattern. The number of capturing parentheses within the pattern is used to compute the number of pairs of offsets that are required in the match data block. These form the "output vector" (ovector) within the match data block, and are used to identify the matched string and any captured substrings when matching with Match().
Use this to allocate a match data object for a specific code object.
See also:
PCRE2MatchDataMBS.Constructor(size as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Regular Expressions | MBS RegEx Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The first argument specifies the number of pairs of offsets that are required. These form the "output vector" (ovector) within the match data block, and are used to identify the matched string and any captured substrings when matching with Match(). There is always one pair of offsets; if size is zero, it is treated as one.
Use this to allocate a match data object with a bigger size to use it with various pattern.
See also:
PCRE2MatchDataMBS.OffsetVector(index as Integer) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Regular Expressions | MBS RegEx Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Values in number of characters and zero based, so maybe use Middle() function on strings.
Range is 0 to OffsetVectorCount*2-1.
OffsetVector(0) and OffsetVector(1) is the total match found.
OffsetVector(2) and OffsetVector(3) is the first captured sub string.
OffsetVector(4) and OffsetVector(5) is the second captured sub string.
...
OffsetVector(OffsetVectorCount*2-2) and OffsetVector(OffsetVectorCount*2-1) is the last captured sub string.
Some examples using this method:
PCRE2MatchDataMBS.OffsetVectors as Integer()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Regular Expressions | MBS RegEx Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
All the values in an array for faster access.
PCRE2MatchDataMBS.SubString(Index as Integer) as String
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Regular Expressions | MBS RegEx Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
PCRE2MatchDataMBS.SubString(Name as String) as String
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Regular Expressions | MBS RegEx Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
PCRE2MatchDataMBS.SubStrings as String()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Regular Expressions | MBS RegEx Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The items on this page are in the following plugins: MBS RegEx Plugin.