Lokad.Utf8Regex 0.4.0

Prefix Reserved
dotnet add package Lokad.Utf8Regex --version 0.4.0
                    
NuGet\Install-Package Lokad.Utf8Regex -Version 0.4.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lokad.Utf8Regex" Version="0.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lokad.Utf8Regex" Version="0.4.0" />
                    
Directory.Packages.props
<PackageReference Include="Lokad.Utf8Regex" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lokad.Utf8Regex --version 0.4.0
                    
#r "nuget: Lokad.Utf8Regex, 0.4.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Lokad.Utf8Regex@0.4.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lokad.Utf8Regex&version=0.4.0
                    
Install as a Cake Addin
#tool nuget:?package=Lokad.Utf8Regex&version=0.4.0
                    
Install as a Cake Tool

Lokad.Utf8Regex

0.4.0, .NET 10. Regular expressions over strict UTF-8 ReadOnlySpan<byte> / Span<byte>, matching Unicode scalars with primary byte coordinates. Dot matches 😀 once across four bytes. UTF-16 coordinates and string APIs are derived interoperability conveniences.

using Lokad.Utf8Regex;

var regex = new Utf8Regex(".");
int count = regex.Count("A😀"u8); // 2
var match = regex.Match("😀"u8); // LengthInBytes == 4

The owned managed engine supports documented .NET-style grammar, captures/history, backreferences, assertions, RTL and a supported NonBacktracking subset, with native UTF-8 search paths. It does not execute BCL Regex matchers/results or promise UTF-16 parity. CultureInvariant is the primary supported mode. Whole subjects must be valid UTF-8, including suffixes after an early match. Core uses ordered alternatives, not POSIX leftmost-longest matching.

Optional IL preparation is skipped when the host disables dynamic code, including with Compiled; non-emitted execution preserves results. NativeAOT publishing and trimming have not been qualified.

Replacement callbacks can pass local stack buffers and formatting slices to Utf8ReplacementWriter.Append. Its scoped byte/char span inputs are copied or encoded before returning; the writer remains valid only during the callback.

Instances support finite Utf8ResourcePolicy work, depth, working-capacity and result-capacity limits. Defaults and static cached calls are unlimited. Original cancellation and absolute deadlines cover validation, matching, required shaping and cursor advances. Explicit Compile factories offer separate construction controls. Memory accounting admits modeled major capacity before allocation; it is not total heap/RSS, all preparation, callbacks or retained-host storage containment. See resource contract.

Keep borrowed subjects unchanged and their owners alive. Owned snapshots remain valid after advance/failure/disposal. Copied value cursors retain independent positions while sharing allowance/deadline. A host must separately account for retained results and its own storage.

Optional Lokad.Utf8Regex.PythonRe and Lokad.Utf8Regex.Pcre2 0.4.0 require exactly this Core version. Both are managed profile adapters with explicit compatibility boundaries; no native PCRE2 binary is shipped.

Read release notes and migration guide. The repository specification defines the target contract; qualification fixtures establish implemented scope. Performance snapshots retain their recorded source/package/runtime identities.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Lokad.Utf8Regex:

Package Downloads
Lokad.Utf8Regex.PythonRe

Optional Python re companion package for Lokad.Utf8Regex, providing a UTF-8 oriented Python-style regular expression API without forcing Python-specific semantics into the base library.

Lokad.Utf8Regex.Pcre2

Optional PCRE2 companion package for Lokad.Utf8Regex, providing a UTF-8 oriented PCRE2 API surface without forcing PCRE2 dependencies onto the base library.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.4.0 1,388 10/27/2026
0.3.0 410 8/28/2026
0.2.0 3,516 4/29/2026
0.1.0 375 4/13/2026