Lune

SIGMOD2023Top-tier venue

Exploiting Structure in Regular Expression Queries

Ling Zhang, Shaleen Deep, Avrilia Floratou, Anja Gruenheid, Jignesh M. Patel, Yiwen Zhu

Abstract

Regular expression, or regex, is widely used to extract critical information from a large corpus of formatted text by finding patterns of interest. In tasks like log processing, the speed of regex matching is crucial. Data scientists and developers regularly use regex libraries that implement optimized regular expression matching using modern automata theory. However, computing state transitions in the underlying regex evaluation engine can be inefficient when a regex query contains a multitude of string literals. This inefficiency is further exasperated when analyzing large data volumes. This paper presents BLARE, Blazingly Fast Regular Expression, a regular expression matching framework that is inspired by the mechanisms that are used in database engines, which use a declarative framework to explore multiple equivalent execution plans, all of which produce the correct final result. Similarly, BLARE decomposes a regex into multiple regex and string components and then creates evaluation strategies in which the components can be evaluated in an order that is not strictly a left-to-right translation of the input regex query. Rather than using a cost-based optimization approach, BLARE uses an adaptive runtime strategy based on a multi-armed bandit approach to find an efficient execution plan. BLARE is also modular and can be built on top of any existing regex library. We implemented BLARE on four commonly used regex libraries, RE2, PCRE2, Boost Regex, and ICU Regex, and evaluated it using two production workloads and one open-source workload. BLARE was 1.6× to 3.7× faster than RE2 and 3.4× to 7.9× faster than Boost Regex. PCRE2 did not finish on one of the workloads, but on the remaining two workloads, BLARE improved the performance of PCRE2 by 3.1× to over 100×. For the open-source dataset, BLARE provided a speed up of 61.7× for ICU Regex. BLARE code is publicly available at https://github.com/mush-zhang/Blare.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

3 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Regular Expression Indexing for Log Analysis cites An Evaluation of N-Gram Selection Strategies for Regular Expression Indexing in Contemporary Text Analysis Tasks
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers3

  1. Analyzing Near-Network Hardware Acceleration with Co-Processing on DPUsDimitrios Giouroukis, Dwi P. A. Nugroho, Varun Pandey, Steffen Zeuch et al.VLDB 2025 · 3 citations
  2. An Evaluation of N-Gram Selection Strategies for Regular Expression Indexing in Contemporary Text Analysis TasksLing Zhang, Shaleen Deep, Jignesh M. Patel, Karthikeyan SankaralingamVLDB 2025 · 2 citations
  3. Regular Expression Indexing for Log AnalysisLing Zhang, Shaleen Deep, Jignesh M. Patel, Karthikeyan SankaralingamSIGMOD 2026

Builds on3

  1. Achieving 100Gbps Intrusion Prevention on a Single ServerZhipeng Zhao, Hugo Sadok, Nirav Atre, James C. Hoe et al.OSDI 2020 · 38 citations
  2. Finding data compatibility bugs with JSON subschema checkingAndrew Habib, Avraham Shinnar, Martin Hirzel, Michael PradelISSTA 2021 · 16 citations
  3. : Near-Storage Accelerator for High-Performance Log AnalyticsSeongyoung Kang, Jiyoung An, Jinpyo Kim, Sang-Woo JunMICRO 2021 · 9 citations

Related papers

  1. REmatch: a novel regex engine for finding all matchesCristian Riveros, Nicolás Van Sint Jan, Domagoj VrgocVLDB 2023 · 10 citations
  2. HybridSA: GPU Acceleration of Multi-pattern Regex Matching using Bit ParallelismAlexis Le Glaunec, Lingkun Kong, Konstantinos MamourasOOPSLA 2024 · 6 citations
  3. SuSe: Summary Selection for Regular Expression Subsequence Aggregation over StreamsSteven Purtzel, Matthias WeidlichSIGMOD 2025 · 1 citation
  4. ALVEARE: a Domain-Specific Framework for Regular ExpressionsFilippo Carloni, Davide Conficconi, Marco D. SantambrogioDAC 2024 · 4 citations
  5. New Regular Expressions on Old AcceleratorsJackson Woodruff, Michael F. P. O'BoyleDAC 2021 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines