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.


The biggest plugin in space...