Resharp 0.1.17
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Resharp --version 0.1.17
NuGet\Install-Package Resharp -Version 0.1.17
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="Resharp" Version="0.1.17" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Resharp" Version="0.1.17" />
<PackageReference Include="Resharp" />
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 Resharp --version 0.1.17
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Resharp, 0.1.17"
#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 Resharp@0.1.17
#: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=Resharp&version=0.1.17
#tool nuget:?package=Resharp&version=0.1.17
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
RE# - An unconventional high-performance regex engine supporting intersection and complement
web application and examples: https://iev.ee/resharp/
Important syntax
_- any character (same as [\s\S] or [\w\W])~- complement, ex. "does not contain 1" ⇒~(_*1_*)&- intersection, ex. "contains cat and dog and 5-15 chars long" ⇒_*cat_*&_*dog_*&_{5,15}
Note: The public API is still subject to change without backwards compatibility. Beta testers are very welcome!
Basic usage
#r "nuget: resharp, 0.0.18"
let matches =
Resharp.Regex("hello.*world").Matches("hello world!")
High performance usage on slices
note: the byte stream api is not finished so file must fit into memory
#r "nuget: resharp, 0.0.18"
open System
open System.IO
// building the engine is the most expensive part, reuse this
let regex = Resharp.Regex("abc", Resharp.ResharpOptions.HighThroughputDefaults)
let matchOnFile(filePath:string) =
// part 1. read the file without allocating
// if you dont care about this part and your file is
// below string max size just do `File.ReadAllText("")`
let info = FileInfo(filePath)
let rentedBytes = Buffers.ArrayPool<byte>.Shared.Rent(int info.Length)
let byteSpan = rentedBytes.AsSpan().Slice(0,int info.Length)
use stream = File.OpenRead(filePath)
stream.ReadExactly(byteSpan)
let decoder = Text.Encoding.Default.GetDecoder()
let charCount = decoder.GetCharCount(byteSpan, false)
let rentedChars = Buffers.ArrayPool<char>.Shared.Rent(int charCount)
let charSpan = rentedChars.AsSpan(0,charCount)
let _ = decoder.GetChars(byteSpan, charSpan, false)
// part 2. matching without allocating
use results = regex.MatchSlices(charSpan)
for slice in results do
// only allocate text if you need to
let matchText = slice.GetText(charSpan)
stdout.WriteLine
$"{slice.Index} {slice.Length} : {matchText}"
// part 3. return pooled resources
Buffers.ArrayPool<byte>.Shared.Return(rentedBytes)
Buffers.ArrayPool<char>.Shared.Return(rentedChars)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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.
-
net8.0
- FSharp.Core (>= 8.0.300)
-
net9.0
- FSharp.Core (>= 8.0.300)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.5 | 1,150 | 7/4/2026 |
| 1.0.4 | 122 | 7/3/2026 |
| 1.0.3 | 2,686 | 3/12/2026 |
| 1.0.2 | 703 | 3/1/2026 |
| 1.0.1 | 169 | 2/24/2026 |
| 1.0.0 | 150 | 2/22/2026 |
| 0.2.2-library | 224 | 9/29/2025 |
| 0.2.1 | 1,566 | 9/27/2025 |
| 0.2.1-library | 142 | 9/27/2025 |
| 0.1.34 | 661 | 2/22/2025 |
| 0.1.33 | 367 | 11/30/2024 |
| 0.1.25 | 820 | 6/27/2024 |
| 0.1.24 | 206 | 6/27/2024 |
| 0.1.17 | 247 | 6/8/2024 |
| 0.0.1-library | 214 | 12/11/2024 |
Loading failed