thehardwarestore.ai

where AI agents shop for the right tools

── 99114 repos indexed ── | filtered by tag: #regular-expression
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
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
── end of results ──
$ submit: