Platforms to show: All Mac Windows Linux Cross-Platform
Back to RegExMBS class.
RegExMBS.Compile(pattern as string) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Regular Expressions | MBS RegEx Plugin | 6.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Some predefined patterns like \b do not support Unicode well, so you may work around that by using your own pattern.
Returns true on success and false on failure.
ErrorMessage, Lasterror, ErrorOffset and Handle are set.
The following table lists the error codes than may be returned by Compile(), along with the error messages that may be returned by both compiling functions.
| 0 | no error |
| 1 | \ at end of pattern |
| 2 | \c at end of pattern |
| 3 | unrecognized character follows \ |
| 4 | numbers out of order in {} quantifier |
| 5 | number too big in {} quantifier |
| 6 | missing terminating ] for character class |
| 7 | invalid escape sequence in character class |
| 8 | range out of order in character class |
| 9 | nothing to repeat |
| 10 | operand of unlimited repeat could match the empty string |
| 11 | internal error: unexpected repeat |
| 12 | unrecognized character after (? |
| 13 | POSIX named classes are supported only within a class |
| 14 | missing ) |
| 15 | reference to non-existent subpattern |
| 16 | erroffset passed as NULL |
| 17 | unknown option bit(s) set |
| 18 | missing ) after comment |
| 19 | parentheses nested too deeply |
| 20 | regular expression too large |
| 21 | failed to get memory |
| 22 | unmatched parentheses |
| 23 | internal error: code overflow |
| 24 | unrecognized character after (?< |
| 25 | lookbehind assertion is not fixed length |
| 26 | malformed number after (?( |
| 27 | conditional group contains more than two branches |
| 28 | assertion expected after (?( |
| 29 | (?R or (?digits must be followed by ) |
| 30 | unknown POSIX class name |
| 31 | POSIX collating elements are not supported |
| 32 | this version of PCRE is not compiled with PCRE_UTF8 support |
| 33 | spare error |
| 34 | character value in \x{...} sequence is too large |
| 35 | invalid condition (?(0) |
| 36 | \C not allowed in lookbehind assertion |
| 37 | PCRE does not support \L, \l, \N, \U, or \u |
| 38 | number after (?C is > 255 |
| 39 | closing ) for (?C expected |
| 40 | recursive call could loop indefinitely |
| 41 | unrecognized character after (?P |
| 42 | syntax error after (?P |
| 43 | two named groups have the same name |
| 44 | invalid UTF-8 string |
| 45 | support for \P, \p, and \X has not been compiled |
| 46 | malformed \P or \p sequence |
| 47 | unknown property name after \P or \p |
RegExMBS.CompileMemory(pattern as memoryblock, ByteOffset as Integer) as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Regular Expressions | MBS RegEx Plugin | 6.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Same as Compile, but the text is stored in a memoryblock and must be a 0 terminated C string.
Be careful to use valid UTF8 input and provide offset in byte units and not in characters.
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Regular Expressions | MBS RegEx Plugin | 11.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
A value of 0 means that \R matches any Unicode line ending sequence; a value of 1 means that \R matches only CR, LF, or CRLF. The default can be overridden when a pattern is compiled or matched.
RegExMBS.ConfigLinkSize as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Regular Expressions | MBS RegEx Plugin | 11.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The value is 2, 3, or 4. Larger values allow larger regular expressions to be compiled, at the expense of slower matching. The default value of 2 is sufficient for all but the most massive patterns, since it allows the compiled pattern to be up to 64K in size.
RegExMBS.ConfigMallocThreshold as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Regular Expressions | MBS RegEx Plugin | 11.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
RegExMBS.ConfigMatchLimit as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Regular Expressions | MBS RegEx Plugin | 11.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
RegExMBS.ConfigMatchLimitRecursion as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Regular Expressions | MBS RegEx Plugin | 11.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
RegExMBS.ConfigNewLine as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Regular Expressions | MBS RegEx Plugin | 11.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The output is an integer whose value specifies the default character sequence that is recognized as meaning "newline". The four values that are supported are: 10 for LF, 13 for CR, 3338 for CRLF, -2 for ANYCRLF, and -1 for ANY. Though they are derived from ASCII, the same values are returned in EBCDIC environments. The default should normally correspond to the standard sequence for your operating system.
RegExMBS.ConfigStackRecurse as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Regular Expressions | MBS RegEx Plugin | 11.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This is the usual way that PCRE is compiled. The output is zero if PCRE was compiled to use blocks of data on the heap instead of recursive function calls. In this case, malloc and free are called to manage memory blocks on the heap, thus avoiding the use of the stack.
RegExMBS.ConfigUnicodeProperties as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Regular Expressions | MBS RegEx Plugin | 11.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Should be true for the plugin.
RegExMBS.ConfigUTF8 as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Regular Expressions | MBS RegEx Plugin | 11.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If this ever is false, please complain. This plugin is designed to work only on UTF8 strings for best performance.
Some examples using this method:
RegExMBS.Constructor(VecSize as Integer = 0)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Regular Expressions | MBS RegEx Plugin | 13.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
You pass here the internal vector size which limits how many substrings you can find.
For 20 substrings, you need to pass (20+1)*3 for vector size.
The items on this page are in the following plugins: MBS RegEx Plugin.