What is Regular expression?
A regular expression (regex) is a pattern that describes a set of strings, used to search, match, validate and replace text. Built from literal characters and special metacharacters (like . * + ? [ ] ( )), it is supported by virtually every programming language and text editor.
Regex combines literals with metacharacters: . matches any character, */+/? are quantifiers, [...] is a character class, ( ) groups, and ^/$ anchor to start/end. For example ^\d{3}-\d{4}$ matches a 7-digit phone number.
Regexes power form validation (emails, URLs), search-and-replace, log parsing and tokenizing — but complex patterns can be hard to read, so keep them documented.
Regular expression tools
Trình tạo dữ liệu Regex
Tạo 1–100 chuỗi khớp với bất kỳ mẫu regex nào. Rất phù hợp cho dữ liệu test, fixture và fuzzing.
Mở công cụTrình kiểm tra JSONPath
Kiểm tra biểu thức JSONPath trên dữ liệu JSON của bạn. Trình đánh giá trực tiếp trả về cả path và value, hỗ trợ filter, slice, recursive descent.
Mở công cụTrình kiểm tra XPath
Kiểm tra biểu thức XPath trên tài liệu XML hoặc HTML bằng công cụ XPath gốc của trình duyệt. Bảng kết quả cập nhật trực tiếp.
Mở công cụCâu hỏi thường gặp
Phiên bản XPath nào được hỗ trợ?
XPath 1.0 — phiên bản được trình duyệt hỗ trợ gốc. Các tính năng của XPath 2.0/3.0 (regex, sequence, kiểu dữ liệu) chưa được hỗ trợ.
Vì sao truy vấn HTML của tôi không trả về kết quả nào?
Chế độ HTML sẽ bọc đoạn mã của bạn trong <code class="font-mono">html/body</code>. Hãy điều chỉnh biểu thức cho phù hợp (ví dụ: <code class="font-mono">//body//div</code>).
Các công cụ liên quan?
<a class="text-brand-600 hover:underline" href="/jsonpath-tester">JSONPath Tester</a> để truy vấn JSON; <a class="text-brand-600 hover:underline" href="/xml-formatter">XML Formatter</a> để làm sạch XML trước.