./prontouso.com
CÔNG CỤ LẬP TRÌNH

Kiểm Tra Biểu Thức Chính Quy (Regex)

Kiểm tra biểu thức chính quy (Regular Expression) trên văn bản mẫu theo thời gian thực. Làm nổi bật các nhóm chụp (capturing groups) và hỗ trợ các cờ g, i, m, s, u.

Trạng thái công cụChạy trên trình duyệt của bạn
Xem trước

Dữ liệu đầu vào

Kết quả

Matches
2
Trạng thái
OK
  • hello@example.comIndex 8 · 0 capture group(s)
  • support@example.orgIndex 29 · 0 capture group(s)

Matches update as you edit the pattern, flags, or text.

Cách thức hoạt động

  1. Nhập dữ liệu của bạn

    Điền các giá trị cần thiết, dán văn bản hoặc tải lên tệp bạn muốn xử lý.

  2. Xem kết quả tức thì

    Hầu hết các công cụ cập nhật theo thời gian thực khi bạn nhập liệu; một số công cụ sử dụng một nút hành động duy nhất.

  3. Sử dụng kết quả

    Sao chép, tải xuống hoặc chia sẻ kết quả được tạo — bạn luôn có toàn quyền kiểm soát dữ liệu của mình.

Quyền riêng tư & xử lý dữ liệuChạy cục bộ 100% trên trình duyệt của bạn. Công cụ này không tải dữ liệu của bạn lên máy chủ.

Kiểm Tra Biểu Thức Chính Quy (Regex) là gì?

Test a JavaScript regular expression against real text, inspect matches and capture groups, and preview replacement output.

TÌM HIỂU CÁCH HOẠT ĐỘNG CỦA CÔNG CỤ

How to test a regular expression

How to use it

  • Enter the regex pattern without surrounding slashes.
  • Add flags such as g, i, or m when needed.
  • Paste the text you want to test.
  • Review the match count, match positions, capture groups, and replacement preview.

Useful checks

Regex testers are useful for validating form patterns, cleaning log data, preparing search-and-replace rules, and debugging capture groups before they go into code.

Debugging tips

  • Start with a small sample before testing a long document.
  • Add the g flag when you want all matches.
  • Use capture groups to confirm which part of the match you will reuse.

RegExp notes

The tester uses JavaScript RegExp behavior. Patterns written for PCRE, .NET, Java, or database engines may need adjustment before they match the same way.

Các Câu Hỏi Thường Gặp (FAQ)

Which regex flavor does this use?

It uses JavaScript regular expressions, the same flavor used by modern browsers.

Why does a valid regex from another language fail?

Regex syntax differs between engines. A pattern from PCRE, Python, or Java may need small changes for JavaScript.

Does it limit matches?

Yes. The preview stops after 200 matches so a runaway pattern does not overwhelm the page.

Why are matches capped?

The tester lists up to 200 matches so an accidental broad pattern does not freeze the page.

Công Cụ Liên Quan