Best regexp alternative for Go. Benchmarks. Plots.

This page summarizes the projects mentioned and recommended in the original post on dev.to

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
InfluxDB high-performance time series database
Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.
influxdata.com
featured
  1. go-re2

    Drop-in replacement for regexp using re2, for any Go app

    go-re2 (1.3.0) - as simple as possible replaces the default regexp. Uses C++ re2 to improve performance when dealing with large inputs or complex expressions;

  2. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  3. regexp2

    A full-featured regex engine in pure Go based on the .NET engine

    regexp2 (1.10.0) - a feature-rich regexp engine for Go. It does not have runtime guarantees like the built-in regexp package, but is compatible with Perl5 and .NET;

  4. go-pcre

    Perl Compatible Regular Expression for Go

    go-pcre (1.0.0) - provides support for Perl compatible regular expressions using libpcre or libpcre++. JIT compilation is available, making this fork much faster than its counterparts. On the downside, you'll need the libpcre3-dev dependency;

  5. rure-go

    Go bindings to Rust's regex engine.

    rure-go (regex 1.9.3) - uses the Rust regex engine with CGo bindings. The downside is a Rust library dependency that needs to be compiled;

  6. gohs

    GoLang Binding of HyperScan https://www.hyperscan.io/

    gohs (1.2.2 + hs5.4.1) - regex engine designed for high performance. It is implemented as a library that provides a simple C-API. It also requires compilation and linking of third-party dependencies;

  7. go-yara

    Go bindings for YARA

    go-yara - A tool for identifying and classifying malware samples. Although YARA has functionality for templating and regular expressions, it is very limited, so I will not include this library in the upcoming tests.

  8. regex-benchmark

    It's just a simple regex benchmark of different programming languages.

    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....

  9. InfluxDB

    InfluxDB high-performance time series database. Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.

    InfluxDB logo
  10. regexcmp

    A tool to compare different regexp libraries in Go

    To answer these questions, I wrote a small benchmarking program that can be used to compare different regex engines in terms of speed and memory usage. If you want to test it yourself or evaluate the correctness of the used methods, here is the code.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Please ask questions (rust-lang/regex)

    1 project | /r/hypeurls | 30 Aug 2023
  • Please ask questions (rust-lang/regex)

    1 project | news.ycombinator.com | 28 Aug 2023
  • ScripterC - Rust-lang set

    2 projects | /r/scripterc | 13 Aug 2023
  • Some positive and negative comments after using rust for a while

    2 projects | /r/rust | 20 May 2023
  • Good projects to showcase rust

    1 project | /r/rust | 8 May 2023

Did you know that Go is
the 4th most popular programming language
based on number of references?