Platforms to show: All Mac Windows Linux Cross-Platform
PCRE2CompilerMBS class
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| class | Regular Expressions | MBS RegEx Plugin | 22.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
- 50 properties
- property AllowEmptyClass as Boolean
- property AllowLookaroundBSK as Boolean
- property AllowSurrogateEscapes as Boolean
- property AltBsux as Boolean
- property AltCircumflex as Boolean
- property AltExtendedClass as Boolean New in 26.4
- property AltVerbNames as Boolean
- property Anchored as Boolean
- property AutoCallout as Boolean
- property BadEscapeIsLiteral as Boolean
- property BSR as Integer
- property Caseless as Boolean
- property CaselessRestrict as Boolean New in 26.4
- property DollarEndonly as Boolean
- property DotAll as Boolean
- property DupNames as Boolean
- property EndAnchored as Boolean
- property ErrorOffset as Integer
- property EscapedCRIsLF as Boolean
- property Extended as Boolean
- property ExtendedAltBSUX as Boolean
- property ExtendedMore as Boolean
- property ExtraOptions as Integer
- property Firstline as Boolean
- property Greedy as Boolean
- property Literal as Boolean
- property MatchInvalidUTF as Boolean
- property MatchLine as Boolean
- property MatchUnsetBackref as Boolean
- property MatchWord as Boolean
- property MaxPatternLength as Integer
- property Multiline as Boolean
- property NeverBackslashC as Boolean
- property NeverCallout as Boolean New in 26.4
- property NeverUCP as Boolean
- property NeverUTF as Boolean
- property NewLine as Integer
- property NoAutoCapture as Boolean
- property NoAutoPossess as Boolean
- property NoDotStarAnchor as Boolean
- property NoStartOptimize as Boolean
- property NoUTFCheck as Boolean
- property Options as Integer
- property ParensNestLimit as Integer
- property Pattern as String
- property TurkishCasing as Boolean New in 26.4
- property UCP as Boolean
- property Ungreedy as Boolean
- property UseOffsetLimit as Boolean
- property UTF as Boolean
- 4 methods
- method Compile as PCRE2CodeMBS
- method Constructor
- method Copy as PCRE2CompilerMBS
- method SetOptimize(Flag as Integer) New in 26.4
- 18 shared properties
- shared property AllocationBytes as Int64
- shared property AllocationCount as Int64
- shared property CompiledWidths as Integer
- shared property DefaultBSR as Integer
- shared property DefaultDepthLimit as Integer
- shared property DefaultHeapLimit as Integer
- shared property DefaultMatchLimit as Integer
- shared property DefaultNewLine as Integer
- shared property DefaultParensLimit as Integer
- shared property EffectiveLinksize as Integer New in 26.4
- shared property HasJIT as Boolean
- shared property HasUnicode as Boolean
- shared property JITTarget as String
- shared property LinkSize as Integer
- shared property MonitorAllocations as Boolean
- shared property NeverBackslashC as Boolean
- shared property PCRE2Version as String
- shared property UnicodeVersion as String
- 16 constants
Constants
| Constant | Value | Description |
|---|---|---|
| kOptimizationAutoPossess | 64 |
Enable/disable "auto-possessification" of variable quantifiers such as * and +.
This optimization, for example, turns a+b into a++b in order to avoid backtracks into a+ that can never be successful. However, if callouts are in use, auto-possessification means that some callouts are never taken. You can disable this optimization if you want the matching functions to do a full, unoptimized search and run all the callouts. |
BSR
| Constant | Value | Description |
|---|---|---|
| kBSRanyCRLF | 2 |
CR, LF, or CRLF only |
| kBSRUnicode | 1 |
Unicode line endings |
New Line Character
| Constant | Value | Description |
|---|---|---|
| kNewLineAny | 4 |
Any Unicode newline sequence. |
| kNewLineAnyCRLF | 5 |
CR, LF or CRLF. |
| kNewLineCR | 1 |
Carriage return only |
| kNewLineCRLF | 3 |
CR followed by LF only |
| kNewLineLF | 2 |
Linefeed only |
| kNewLineNul | 6 |
The NUL character (binary zero) |
Optimization Flags
| Constant | Value | Description |
|---|---|---|
| kOptimizationAutoPossessOff | 65 |
Enable/disable "auto-possessification" of variable quantifiers such as * and +. This optimization, for example, turns a+b into a++b in order to avoid backtracks into a+ that can never be successful. However, if callouts are in use, auto-possessification means that some callouts are never taken. You can disable this optimization if you want the matching functions to do a full, unoptimized search and run all the callouts. |
| kOptimizationDotstarAnchor | 66 | Enable/disable an optimization that is applied when .* is the first significant item in a top-level branch of a pattern, and all the other branches also start with .* or with \A or \G or ^. Such a pattern is automatically anchored if PCRE2_DOTALL is set for all the .* items and PCRE2_MULTILINE is not set for any ^ items. Otherwise, the fact that any match must start either at the start of the subject or following a newline is remembered. Like other optimizations, this can cause callouts to be skipped. more |
| kOptimizationDotstarAnchorOff | 67 | Enable/disable an optimization that is applied when .* is the first significant item in a top-level branch of a pattern, and all the other branches also start with .* or with \A or \G or ^. Such a pattern is automatically anchored if PCRE2_DOTALL is set for all the .* items and PCRE2_MULTILINE is not set for any ^ items. Otherwise, the fact that any match must start either at the start of the subject or following a newline is remembered. Like other optimizations, this can cause callouts to be skipped. more |
| kOptimizationFull | 1 |
Enable all optional performance optimizations. This is the default value. |
| kOptimizationNone | 0 |
Disable all optional performance optimizations. |
| kOptimizationStartOptimize | 68 | Enable/disable optimizations which cause matching functions to scan the subject string for specific code unit values before attempting a match. For example, if it is known that an unanchored match must start with a specific value, the matching code searches the subject for that value, and fails immediately if it cannot find it, without actually running the main matching function. This means that a special item such as (*COMMIT) at the start of a pattern is not considered until after a suitable starting point for the match has been found. Also, when callouts or (*MARK) items are in use, these "start-up" optimizations can cause them to be skipped if the pattern is never actually used. The start-up optimizations are in effect a pre-scan of the subject that takes place before the pattern is run. more |
| kOptimizationStartOptimizeOff | 69 | Enable/disable optimizations which cause matching functions to scan the subject string for specific code unit values before attempting a match. For example, if it is known that an unanchored match must start with a specific value, the matching code searches the subject for that value, and fails immediately if it cannot find it, without actually running the main matching function. This means that a special item such as (*COMMIT) at the start of a pattern is not considered until after a suitable starting point for the match has been found. Also, when callouts or (*MARK) items are in use, these "start-up" optimizations can cause them to be skipped if the pattern is never actually used. The start-up optimizations are in effect a pre-scan of the subject that takes place before the pattern is run. more |
This class has no sub classes.
Blog Entries
- MBS Xojo Plugins, version 26.4pr6
- The Top 10 from the MBS Xojo Plugins in 2022
- News from the MBS Xojo Plugins Version 22.2
- Iterate with PCRE2
- New PCRE2 Plugin for Xojo
- MBS Xojo Plugins, version 22.2pr4
Xojo Developer Magazine
- 21.1, page 27: News from MBS Xojo Plugins, What's up with MonkeyBread Software by Stefanie Juchmes
- 20.6, page 70: Regular Expressions with Xojo, The MBS Plugins has its own RegEx library by Stefanie Juchmes
Release notes
- Version 26.4
- Added SetOptimize method to PCRE2CompilerMBS class and related constants.
- Added TurkishCasing, NeverCallout, EffectiveLinksize, CaselessRestrict, AltExtendedClass properties to PCRE2CompilerMBS class.
Some examples using this class:
Some related classes:
The items on this page are in the following plugins: MBS RegEx Plugin.
PCRE2CodeMBS - PCRE2ExceptionMBS