All Projects → iwillspeak → IronRure

iwillspeak / IronRure

Licence: MIT license
.NET Bindings to the Rust Regex Crate

Programming Languages

C#
18002 projects
shell
77523 projects

Projects that are alternatives of or similar to IronRure

Regex Benchmark
It's just a simple regex benchmark of different programming languages.
Stars: ✭ 171 (+968.75%)
Mutual labels:  regex, regexp
url-regex-safe
Regular expression matching for URL's. Maintained, safe, and browser-friendly version of url-regex. Resolves CVE-2020-7661 for Node.js servers.
Stars: ✭ 59 (+268.75%)
Mutual labels:  regex, regexp
Common Regex
🎃 常用正则表达式 - 收集一些在平时项目开发中经常用到的正则表达式。
Stars: ✭ 2,488 (+15450%)
Mutual labels:  regex, regexp
Xioc
Extract indicators of compromise from text, including "escaped" ones.
Stars: ✭ 148 (+825%)
Mutual labels:  regex, regexp
Regaxor
A regular expression fuzzer.
Stars: ✭ 35 (+118.75%)
Mutual labels:  regex, regexp
Regex
An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.
Stars: ✭ 2,125 (+13181.25%)
Mutual labels:  regex, regexp
Regex Automata
A low level regular expression library that uses deterministic finite automata.
Stars: ✭ 203 (+1168.75%)
Mutual labels:  regex, regexp
Orchestra
One language to be RegExp's Successor. Visually readable and rich, technically safe and extended, naturally scalable, advanced, and optimized
Stars: ✭ 103 (+543.75%)
Mutual labels:  regex, regexp
moar
Deterministic Regular Expressions with Backreferences
Stars: ✭ 19 (+18.75%)
Mutual labels:  regex, regexp
Regex For Regular Folk
🔍💪 Regular Expressions for Regular Folk — A visual, example-based introduction to RegEx [BETA]
Stars: ✭ 242 (+1412.5%)
Mutual labels:  regex, regexp
Regex Dos
👮 👊 RegEx Denial of Service (ReDos) Scanner
Stars: ✭ 143 (+793.75%)
Mutual labels:  regex, regexp
cregex
A small implementation of regular expression matching engine in C
Stars: ✭ 72 (+350%)
Mutual labels:  regex, regexp
Learn Regex Zh
🇨🇳 翻译: 学习正则表达式的简单方法
Stars: ✭ 1,772 (+10975%)
Mutual labels:  regex, regexp
Grex
A command-line tool and library for generating regular expressions from user-provided test cases
Stars: ✭ 4,847 (+30193.75%)
Mutual labels:  regex, regexp
Proposal Regexp Unicode Property Escapes
Proposal to add Unicode property escapes `\p{…}` and `\P{…}` to regular expressions in ECMAScript.
Stars: ✭ 112 (+600%)
Mutual labels:  regex, regexp
Regexpu
A source code transpiler that enables the use of ES2015 Unicode regular expressions in ES5.
Stars: ✭ 201 (+1156.25%)
Mutual labels:  regex, regexp
Hyperscan Java
Match tens of thousands of regular expressions within milliseconds - Java bindings for Intel's hyperscan 5
Stars: ✭ 66 (+312.5%)
Mutual labels:  regex, regexp
Youtube Regex
Best YouTube Video ID regex. Online: https://regex101.com/r/rN1qR5/2 and http://regexr.com/3anm9
Stars: ✭ 87 (+443.75%)
Mutual labels:  regex, regexp
Stringi
THE String Processing Package for R (with ICU)
Stars: ✭ 204 (+1175%)
Mutual labels:  regex, regexp
regexp-example
正则表达式实例搜集,通过实例来学习正则表达式。
Stars: ✭ 162 (+912.5%)
Mutual labels:  regex, regexp

🚀⚙️ IronRure - Rusty Regexs for .NET ⚙️🚀

Rure is the Rust Regular Expression crate. This repo provides a set of bindings so that it can be used from .NET.

Build Status

Getting Started

IronRure targets the .NET Standard runtime. It's available to install on NuGet:

> Install-Package IronRure

If you're targeting Linux, Windows or macOS then it's batteries included. If not then you'll need to supply your own compiled version of rure.

Tutorials

Walkthroughs and example code to get to know the basic features of IronRure.

Contributing

IronRure is open source. Pull requests are welcome. See the Contributing Guidelines and Code of Conduct for more information.

Usage

The simplest operation is to check if a pattern matches anywhere in a given string:

using IronRure;

var re = new Regex(@"\d+");
Assert.True(re.IsMatch("I have 1 number"));
Assert.False(re.IsMatch("I don't"));

All Rust regular expression patterns are unanchored by default. This means that if you want to check if a pattern matches the entire string you'll need to add ^ and $ yourself:

var re = new Regex(@"^\w+$");

Assert.True(re.IsMatch("word"));
Assert.False(re.IsMatch("two words"));

To find the extent of the next match in a string Regex::Find can be used:

var re = new Regex(@"world");

var match = re.Find("hello world");
Assert.True(match.Matched);
Assert.Equal(6U, match.Start);
Assert.Equal(11U, match.End);

Captures

To get information about the extent of each capture group in a regex the Regex::Captures method can be used. This method is slower than Regex::Find or Regex::IsMatch; only use it if you must retrieve capture information.

var dates = new Regex(@"(?P<day>\d{2})/(?P<month>\d{2})/(?P<year>\d{4})");

var haystack = "The first satellite was launched on 04/10/1957";
var caps = dates.Captures(haystack);
Assert.True(caps.Matched);
Assert.Equal("04", caps[dates["day"]].ExtractedString);
Assert.Equal("10", caps[dates["month"]].ExtractedString);
Assert.Equal("1957", caps[dates["year"]].ExtractedString);

Performance

In general IronRure out-performs .NET Regex, although milage may vary depending on the exact pattern and text. For more details checkout the benchmarks.

Syntax and Semantics

For more information about the pattern syntax see the underlying Rust crate documentation.

Windows Gotchas

The windows build of IronRure-Batteries requires the vc140 redistributable to work. This means you need to have Visual Studio 2015 or the Visual Studio 2015 C++ Runtime installed for it to load. If not you'll get an exception which claims that rure.dll can't be found.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].