Đứcgherkins/regexpbuilderphp
🦉 human-readable regular expressions
🔍 RegExpBuilder PHP — Viết biểu thức chính quy như đang gõ code
Tạo regex bằng chain method thay vì nhớ cú pháp rối loạn.
RegExpBuilderPHP là phiên bản PHP của RegExpBuilderJS, giúp xây dựng biểu thức chính quy thông qua các phương thức gọi liên tiếp (chain methods) và biến như chuỗi hoặc mảng. Dự án hỗ trợ PHP 8.2+, có độ phủ test 100%, và cài đặt nhanh qua Composer.
✨ Điểm nổi bật
- Validation: kiểm tra định dạng chuỗi như mã số, tên file.
- Search: tìm kiếm nhiều kết quả trong văn bản.
- Replace: thay thế nội dung khớp bằng hàm callback.
- Multiple patterns: kết hợp nhiều điều kiện với
eitherFind()/orFind(). - Chain methods: dùng
startOfInput(),digits(),letters()... - GetRegExp(): trả về đối tượng RegExp hỗ trợ
matches(),findIn(),replace().
💡 Vì sao đáng chú ý
Thay vì viết regex thủ công với cú pháp khó nhớ, RegExpBuilderPHP biến quá trình xây dựng regex thành các bước logic rõ ràng, dễ đọc như code. Phù hợp cho dự án cần xử lý chuỗi phức tạp nhưng vẫn muốn giữ tính bảo trì cao.
#Regex #PHP #OpenSource #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.
A command-line tool and Rust library with Python bindings for generating regular expressions from user-provided test cases
Melody is a language that compiles to regular expressions and aims to be more readable and maintainable
An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.
A regular expression to match all Emoji-only symbols as per the Unicode Standard.
PCRE2 is a library implementing regular expression pattern matching with a C API