RepositoryRustDEĐức
PE

pemistahl/grex

A command-line tool and Rust library with Python bindings for generating regular expressions from user-provided test cases

8.3ksao
200fork
10issue
2lượt xem

Thành tựu nổi bật

Những danh hiệu mới nhất của dự án

1
TINIX TRENDING·Chủ đề: regular-expressions

#1 Repository Của Tuần

1
TINIX TRENDING·Chủ đề: tool

#1 Repository Của Tuần

1
TINIX TRENDING·Chủ đề: regexp

#1 Repository Của Tuần

🧪 Tự động sinh regex từ test case với grex — tiết kiệm hàng giờ đối với regex

grex sinh regex chiếu xạ chính xác test case đưa vào.

grex là công cụ dòng lệnh và thư viện Rust (có binding Python) sinh regex tự động từ test case người dùng cung cấp. Dự án là port Rust của regexgen JS do Devon Govett viết, thêm tính năng mới. Regex sinh ra tương thích Perl và Rust regex crate.

✨ Điểm nổi bật

  • Sinh regex tự động: nhập test case, ra regex khớp chính xác.
  • CLI + thư viện Rust: dùng dòng lệnh hoặc tích hợp vào code Rust.
  • Hỗ trợ Python: binding Python cho dự án Python.
  • Regex ngắn nhất: thuật toán tìm regex ngắn nhất cho test case.
  • Tùy chỉnh qua flag: biến regex chiếu xạ hẹp thành chung hơn.
  • Escape ký tự phi ASCII: hỗ trợ ký tự Unicode.
  • Phát hiện prefix/suffix chung: tối ưu regex bằng cách gộp chuỗi lặp lại.
  • Alternation và optionality: hỗ trợ | và ? tự động.

💡 Vì sao đáng chú ý

grex giải quyết nhu cầu nhanh chóng có regex đúng từ test case mẫu, tránh viết thủ công lẻn khó. Phù hợp dev cần regex nhanh cho validation, parsing, testing. Tuy nhiên grex không thay thế kỹ năng regex — regex sinh ra cần kiểm tra thủ công nếu cần tối ưu cho engine cụ thể.


#Regex #Rust #CommandLineTool #Python #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

RepositoryRust
BurntSushi/ripgrep

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

69.5k
Oct 27, 2026
RepositoryRust
sharkdp/fd

A simple, fast and user-friendly alternative to 'find'

44.9k
Oct 24, 2026
RepositoryJavaScript
pemistahl/grex-js

A JavaScript / WebAssembly library for generating regular expressions from user-provided test cases

184
Aug 2, 2023
RepositoryRust
sharkdp/bat

A cat(1) clone with wings.

61.0k
Oct 28, 2026
RepositoryRust
yoav-lavi/melody

Melody is a language that compiles to regular expressions and aims to be more readable and maintainable

4.7k
Nov 24, 2024
RepositoryRust
rust-lang/regex

An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.

4.0k
Oct 27, 2026
RepositoryTypeScript
unjs/magic-regexp

A compiled-away, type-safe, readable RegExp alternative

4.3k
Oct 27, 2026
RepositoryJavaScript
mathiasbynens/emoji-regex

A regular expression to match all Emoji-only symbols as per the Unicode Standard.

1.9k
Sep 15, 2026
RepositoryPHP
gherkins/regexpbuilderphp

🦉 human-readable regular expressions

1.3k
Dec 19, 2025