regex VS regex-benchmark

Compare regex vs regex-benchmark and see what are their differences.

regex

An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs. (by rust-lang)

regex-benchmark

It's just a simple regex benchmark of different programming languages. (by mariomka)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
regex regex-benchmark
91 9
3,308 307
1.5% -
9.1 0.0
3 days ago 10 months ago
Rust Dockerfile
Apache License 2.0 MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

regex

Posts with mentions or reviews of regex. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-01-24.

regex-benchmark

Posts with mentions or reviews of regex-benchmark. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-08-26.
  • Best regexp alternative for Go. Benchmarks. Plots.
    8 projects | dev.to | 26 Aug 2023
    Before we start comparing the aforementioned solutions, it is worth to show how bad things are with the standard regex library in Go. I found the project where the author compares the performance of standard regex engines of various languages. The point of this benchmark is to repeatedly run 3 regular expressions over a predefined text. Go came in 3rd place in this benchmark! From the end....
  • Rust vs. Go in 2023
    9 projects | news.ycombinator.com | 13 Aug 2023
    * Let you clone a map without rehashing every key to a new seed. I generally measure at least 15x speedup from this alone, unlocking very useful design patterns like "clone a map and apply a few temporary updates for a one-off operation like validation or simulation" with no extra code complexity. Go gives you no better option than slowly rehashing the entire map.

    And that's just hash maps. How about Go's regex engine being one of the slowest in the world while Rust's regex crate being one of the fastest:

    https://github.com/mariomka/regex-benchmark#optimized

  • Lyra: Fast, in-memory, typo-tolerant, full-text search engine in TypeScript
    10 projects | news.ycombinator.com | 29 Jul 2022
    https://github.com/mariomka/regex-benchmark

    And the always interesting techempower Project, which leaves the implementation to participants of each round. https://www.techempower.com/benchmarks/#section=data-r21&tes...

    Choose whatever category you wish there, js is faster in then go in almost all categories there.

    Even though I said it before, I'm going to repeat myself as I expect you to ignore my previous message: the language doesn't make any implementation fast or slow. You can have a well performing search engine in go, and JS. The performance difference will most likely not be caused by the language with these two choices. And the same will apply with C/Rust. The language won't make the engine performant creating a maximally performant search engine is hard

  • i'd like you to meet regex-
    3 projects | /r/ProgrammerHumor | 14 Mar 2022
    Also, regex engines are not created equally, at all. One of the best writeups I've ever read is from the ripgrep blog. Burntsushi knows regex. There's also this benchmark site which illustrates how general language performance is an entirely different metric than regex performance. Don't assume those benchmarks will cover your particular use case, though--different regex engines might handle your particular situation differently.
  • Go performance from version 1.2 to 1.18
    14 projects | news.ycombinator.com | 3 Feb 2022
    Interesting. Looking at this repo, they have

    Rust -> Ruby -> Java -> Golang

    https://github.com/mariomka/regex-benchmark

    Though it appears the numbers are two years old or so, and only for 3 specific regexes.

  • Hajime can now get hardware information about your MC server, all from Minecraft itself!
    3 projects | /r/admincraft | 31 Jan 2022
    id also be careful in claiming C++ std regex is faster than python, unless you actually have proof. there's a ton of information that in many cases its actually slower. https://github.com/mariomka/regex-benchmark. have you actually benchmarked your code? or was it just a naive assumption that because its C++ its just fast?
  • A Complete Course of the Raku programming language
    4 projects | news.ycombinator.com | 14 Jan 2021
    It is a matter of personal preference.

    I find that regular expressions and text-wrangling tasks are faster and easier in Perl than in other programming languages due to its accessible syntax and regular expression engine speed.

    This article shows the regular expression syntax in several popular programming languages: https://cs.lmu.edu/~ray/notes/regex/

    This GitHub repo gives some regex performance test benchmarks: https://github.com/mariomka/regex-benchmark Perl is pretty fast among the scripting languages that were benchmarked.

    If you are familiar with C / C++, then learning Perl is relatively fast and easy: https://perldoc.perl.org/perlintro

What are some alternatives?

When comparing regex and regex-benchmark you can also consider the following projects:

re2 - modern regular expression syntax everywhere with a painless upgrade path [Moved to: https://github.com/SonOfLilit/kleenexp]

node-re2 - node.js bindings for RE2: fast, safe alternative to backtracking regular expression engines.

zig - General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

ngrams - (Read-only) Generate n-grams

hyperscan - High-performance regular expression matching library

whatlang-rs - Natural language detection library for Rust. Try demo online: https://whatlang.org/

Fluent - Rust implementation of Project Fluent

rust - Rust for the xtensa architecture. Built in targets for the ESP32 and ESP8266

UNIC - UNIC: Unicode and Internationalization Crates for Rust

ripgrep - ripgrep recursively searches directories for a regex pattern while respecting your gitignore

textwrap - An efficient and powerful Rust library for word wrapping text.

rust - Empowering everyone to build reliable and efficient software.