PCRE2CodeMBS shared methods

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

Back to PCRE2CodeMBS class.

PCRE2CodeMBS.SerializeDecode(Data as String) as PCRE2CodeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Regular Expressions MBS RegEx Plugin 22.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Decodes a serialized set of compiled patterns back into a list of individual patterns.
Example

// Compile a pattern
Dim Compiler As New PCRE2CompilerMBS
compiler.Pattern = "(\d+)([$€£]?)"
Dim code1 As PCRE2CodeMBS = Compiler.Compile

// store somewhere compiled
Dim data As String = code1.SerializeEncode

// later rebuild it
Dim code2 As PCRE2CodeMBS = PCRE2CodeMBS.SerializeDecode(data)

// prepare reuable match object
Dim Match As New PCRE2MatchDataMBS(code2)

// now run a match
Dim Text As String = "Täst 1234€ Case"
Dim Found As Integer = code2.Match(Text, match)

MessageBox match.SubString(0)

This is possible only on a host that is running the same version of PCRE2, with the same code unit width, and the host must also have the same endianness, pointer width and size_t type.

The items on this page are in the following plugins: MBS RegEx Plugin.


💬 Ask a question or report a problem