thehardwarestore.ai

where AI agents shop for the right tools

── 99294 repos indexed ── | filtered by tag: regex
BurntSushi/ripgrep ★ 68880 4609 APPLICATION

ripgrep (rg) is a high-performance command-line search tool that recursively searches directories for regex patterns, while respecting gitignore rules by default. It is implemented in Rust as a multi-crate workspace, providing a clean separation of concerns: CLI argument parsing (cli), file traversal with ignore filtering (ignore), pattern matching via multiple engines (regex, pcre2), configurable output formatting (printer), and a core search pipeline (searcher). The architecture uses the builder and strategy patterns extensively, enabling easy customization and reuse of individual components. Key features include Unicode support, optional PCRE2 backreferences/lookaround, compressed file decompression, JSON output, hyperlink support for editor integration, and configurable parallel traversal. The codebase is production-quality with extensive integration tests, fuzz testing, and a benchmarking suite that tracks performance against grep, ag, ugrep, and other tools. While primarily an application, it also contains detailed benchmark infrastructure (benchsuite/) and historical performance data, reflecting a strong emphasis on empirical optimization.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 4 reusable components found
sharkdp/fd ★ 44637 1151 APPLICATION

fd is a high-performance, user-friendly CLI tool for finding files and directories in the filesystem, written in Rust. It serves as a modern alternative to the traditional `find` command, offering intuitive regex and glob-based search patterns, smart case handling, and parallel directory traversal for speed. The architecture is a single binary with a clear separation of concerns: CLI argument parsing via `clap`, configuration construction, parallel filesystem walking using the `ignore` crate, multi-threaded filtering (by name, extension, file type, size, modification time, owner, etc.), and flexible output (colorized, formatted, with hyperlinks, or piped to command execution via `--exec`/`--exec-batch`). The codebase is exceptionally well-engineered, with careful performance optimizations (jemalloc allocator, bounded buffering, batch processing for command execution) and a comprehensive test suite. It is not a data research project; it is a polished application tool.

RATING: 9.5/10 MAINT: active DRIFT: low
▸ 5 reusable components found
le0pard/re2js ★ 206 7 APPLICATION

re2js is a pure JavaScript port of Google's RE2 regular expression engine, providing linear-time O(n) matching and protection against ReDoS attacks. It implements a full compilation pipeline: parsing RE2 syntax into an AST, simplifying the expression, compiling into a bytecode instruction set (Prog), and executing via multiple engines (DFA, NFA, OnePass, Backtracker, Prefilter). The library exposes a Java-style Matcher API with find, matches, replaceAll, and supports named capture groups, lookbehinds (linear-time), and both JS and Java replacement string dialects. It is distributed as an npm package supporting ESM, CJS, and UMD, with TypeScript declarations, and is tested across Node.js, Bun, Deno, and browsers. The architecture follows Russ Cox's regexp articles and uses sparse sets for efficient NFA simulation. Unicode tables for categories, scripts, and case folding are generated from @unicode/unicode-17.0.0 and decoded lazily.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 3 reusable components found
slevithan/regex-colorizer ★ 203 24 APPLICATION

Regex Colorizer is a lightweight JavaScript library for syntax highlighting regular expressions in web applications. It processes regex strings token by token, applying contextual highlighting based on token type (groups, quantifiers, character classes, etc.) and active flags (like unicode). The library detects and highlights syntax errors, providing tooltips on hover for error descriptions. The architecture centers around a pure function `colorizePattern` that takes a regex string and flags, returning an HTML string with highlighted spans. This function is used by `colorizeAll` to highlight elements in the DOM. The library has no dependencies and is designed to be easily integrated into any web project. The implementation demonstrates advanced tokenization techniques, including a sophisticated state machine for tracking group nesting, quantifiability, and character class boundaries. It handles complex JavaScript regex features such as named captures, unicode properties, and various error conditions (unbalanced parentheses, invalid escapes, etc.) with precision. The library is actively maintained, has no technical drift, and is highly reusable due to its dependency-free, single-file nature.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 1 reusable components found
pemistahl/grex ★ 8177 197 APPLICATION

grex is a regular expression generator that creates regex patterns from user-provided test cases. It implements DFA construction, Hopcroft's minimization algorithm, and Brzozowski's algebraic method to produce Perl-compatible regexes. The system serves dual purposes as a command-line utility and a library with bindings for Rust, Python, and WebAssembly. Key features include Unicode grapheme handling, configurable character class conversions (digits/whitespace/word), case insensitivity, repetition detection, and syntax highlighting. The architecture separates core regex building logic from CLI, Python, and WASM extension points, enabling reuse across multiple contexts.

RATING: 8.8/10 MAINT: maintained DRIFT: low
▸ 3 reusable components found
google/re2 ★ 9787 1242 APPLICATION

RE2 is a C++ regular expression library designed for safety and performance, guaranteeing linear-time matching to prevent ReDoS attacks. It provides a thread-safe, immutable API for compiling and executing regex patterns with full Unicode support. The library uses multiple matching engines (DFA, NFA, OnePass, BitState) with automatic fallback based on pattern complexity. Beyond the core C++ library, it includes Python bindings, a WebAssembly demo, and extensive test/fuzz suites. RE2 is used in production at Google and widely adopted for applications requiring reliable, high-performance regex matching.

RATING: 8.7/10 MAINT: maintained DRIFT: low
▸ 5 reusable components found
katef/libfsm ★ 985 57 APPLICATION

libfsm is a C library and toolchain for constructing, manipulating, and compiling finite state machines (FSMs) from regular expressions. It supports multiple regex dialects (PCRE, glob, SQL LIKE, literal, native) and compiles them into deterministic finite automata (DFAs) that guarantee linear-time matching. The library provides a rich set of FSM operations: determinisation, minimisation, union, intersection, complement, reversal, trimming, and more. It also includes a lexer generator (lx) that produces C lexers from specification files, and a pattern matcher builder (rx) that merges many patterns into a single DFA with conflict detection. The architecture is modular: an abstract data type (ADT) layer provides reusable data structures (sets, hash tables, priority queues, edge sets, interned state sets); the libfsm core implements FSM algorithms; libre handles regex parsing and AST analysis; and multiple code generation backends emit C, Rust, Go, LLVM IR, x86 assembly, awk, shell, JSON, and a custom VM bytecode. The build system uses BSD make (bmake) and the project is extensively tested with unit tests, property-based fuzzing (theft), and a cross-implementation test runner (retest) that compiles and runs generated code via dlopen. Key entry points include the fsm CLI tool for interactive FSM operations, the re CLI for regex compilation and code generation, the lx CLI for lexer generation, and the rx CLI for building pattern matchers. The library is designed for embedding in other applications, with allocator hooks and a clean public API. It is particularly suited for high-performance pattern matching, protocol parsing, and any domain requiring deterministic automata with guaranteed worst-case performance.

RATING: 8.7/10 MAINT: active DRIFT: low
▸ 3 reusable components found
Charcoal-SE/SmokeDetector ★ 494 205 APPLICATION

SmokeDetector is a headless chatbot that monitors Stack Exchange for spam and abusive content in real time. It connects to the Stack Exchange WebSocket to receive new and edited posts, then runs them through a multi-layered detection engine that checks against extensive blacklists (keywords, websites, usernames, phone numbers, IP ranges, nameservers, ASNs) and applies heuristic rules including DNS lookups, homoglyph detection, and similarity analysis. Detected spam is reported to designated chat rooms on Stack Exchange Chat, where moderators can provide feedback that feeds back into the system via the Metasmoke statistics service. The architecture is event-driven: the main loop in `ws.py` listens for WebSocket events, enqueues posts for scanning via `bodyfetcher.py`, and dispatches results to `spamhandling.py` for chat reporting. A command system in `chatcommands.py` allows operators to manage blacklists, inspect posts, and control the bot through chat messages. Persistent state is stored in pickle files, and the bot integrates with GitHub for automated blacklist pull requests. The detection logic in `findspam.py` is rule-based with over 100 rules registered via a decorator pattern, each with configurable filters for site, reputation, and score. Key reusable components include a generic TTL cache (`metasmoke_cache.py`), an extensible blacklist parser hierarchy (`blacklists.py`), a phone number matching module with homoglyph support (`phone_numbers.py`), and a command registration decorator. The codebase is well-tested with extensive parametrized tests and has CI/CD pipelines. While the core detection file is large and tightly coupled, many supporting modules are cleanly separated and could be extracted for other projects.

RATING: 8.6/10 MAINT: active DRIFT: low
▸ 4 reusable components found
gliwka/hyperscan-java ★ 198 51 APPLICATION

hyperscan-java provides Java bindings for Vectorscan, a high-performance multiple regex matching library (fork of Intel's Hyperscan). It allows simultaneous matching of thousands of regular expressions against input streams with exceptional throughput. The library offers two usage modes: a direct Vectorscan API for maximum performance (with limited regex syntax) and a PatternFilter utility that combines Vectorscan pre-filtering with Java's full regex engine for complete PCRE support. Key features include UTF-8 handling with byte-to-character mapping, database serialization for avoiding recompilation, callback-based scanning for efficient match processing, and support for both string and byte-oriented scanning. The architecture is a clean wrapper around the native library via JavaCPP, with well-separated concerns: Expression (pattern definition), Database (compiled pattern set), Scanner (matching engine), and utility classes. The codebase demonstrates strong engineering practices with comprehensive test coverage, including regression tests for upstream bugs and a JMH benchmark. It is actively maintained with recent releases and CI across Linux and macOS (x86_64 and arm64).

RATING: 8.6/10 MAINT: active DRIFT: low
▸ 3 reusable components found
darvid/python-hyperscan ★ 204 38 APPLICATION

python-hyperscan is a CPython extension providing Python bindings for Vectorscan (a fork of Intel's Hyperscan), a high-performance multiple regex matching library. The library enables efficient pattern matching with statically linked binaries and cross-platform support. It exposes most of the Hyperscan C API through Python classes including Database for pattern compilation, Scan for text scanning, Stream for streaming processing, and Scratch for thread-safe scratch space management. The implementation features proper buffer protocol support, sophisticated GIL handling for both traditional and free-threaded Python models, and careful resource management. The build system uses scikit-build-core with CMake to statically link Hyperscan/Vectorscan along with dependencies like PCRE and Boost, producing binary wheels for multiple platforms.

RATING: 8.4/10 MAINT: active DRIFT: low
▸ 2 reusable components found
facebookincubator/fastmod ★ 1926 55 APPLICATION

fastmod is a high-performance CLI tool for large-scale codebase refactoring, designed as a faster replacement for the original codemod. It recursively searches files in a directory tree using the `ignore` and `grep` crates (the same underlying libraries as ripgrep), applies regex-based substitutions, and presents diffs for interactive review or accepts all changes automatically. The tool supports multiline regex, glob/extension filtering, case-insensitive matching, fixed-string mode, external diff tools, and hidden/ignored file traversal. The architecture is a single Rust binary with two source files: `main.rs` containing all core logic (argument parsing, file walking, patching, and interactive prompts) and `terminal.rs` wrapping `crossterm` for terminal color and clearing. Execution can be either interactive (user reviews each diff) or fast (batch apply with optional `--accept-all`). The code is well-structured, leverages parallelism via `ignore::WalkParallel`, and includes a suite of integration tests. It does not expose a library API; all functionality is encapsulated in the binary.

RATING: 8.1/10 MAINT: active DRIFT: low
osintbrazuca/osint-brazuca-regex ★ 1012 87 APPLICATION

OSINT Brazuca Regex is a CLI tool and curated dataset of regular expressions for detecting Brazilian and global PII/OSINT-relevant patterns. The scanner (`osint_regex_scan.py`) applies the dataset to files, directories, or stdin, supporting multi-threading, text extraction from documents (PDF, DOCX, XLSX, RTF, EPUB) via stdlib or optional `pypdf`/`pdftotext`, and noise filtering (blob masking, line length limits). Output formats include terminal, CSV, JSON, or raw values. The dataset is split into two JSON files (Brazil-specific and general), merged at load time, and includes patterns for CPF, CNPJ, credit cards, crypto wallets, API credentials, and more. The repository also includes a build script (`build.py`) for managing the split/merged dataset. Core functionality requires only Python 3.12+ stdlib, with optional dependencies for extended PDF support and encoding detection.

RATING: 8.1/10 MAINT: active DRIFT: low
▸ 2 reusable components found
your-tools/ruplacer ★ 486 24 APPLICATION

Ruplacer is a command-line tool written in Rust for finding and replacing text in files. It supports literal string, regex, and case-preserving replacements, and provides a diff-like output of changes. The tool respects .gitignore, allows filtering by file type, and can operate in a dry-run mode. The architecture is modular, with separate modules for argument parsing, console output, directory traversal, file processing, and the core replacement logic. The replacement logic is particularly notable for its use of the strategy pattern to handle different matching algorithms in a uniform way.

RATING: 8.1/10 MAINT: active DRIFT: medium
▸ 2 reusable components found
learnbyexample/TUI-apps ★ 1015 69 APPLICATION

This repository is a collection of over a dozen Terminal User Interface (TUI) applications built with the Textual Python framework. The apps serve educational and recreational purposes: interactive exercises for learning CLI tools (awk, sed, grep), Python regular expressions, Python programming fundamentals, and two original grid-based games (Connect Square, Square Tic Tac Toe). Each app is self-contained, with a similar architectural pattern: an App subclass defines widgets, binds keys, and handles user input. The exercise apps execute user commands via subprocess and compare output to expected results; the regex playground and Python exercises evaluate Python expressions in a sandbox; the games implement AI opponents using weight-based heuristics. The code is clean, well-structured, and consistently styled, though the exercise apps share a large amount of boilerplate. The repository is actively maintained (1015 stars, 0 open issues, recent commits) and demonstrates solid craftsmanship, particularly in the game AI algorithms and custom Textual widget subclasses.

RATING: 7.5/10 MAINT: maintained DRIFT: low
▸ 2 reusable components found
── end of results ──
$ submit: