Skip to content
DevToolKit

Cẩm Nang Regex

Cẩm Nang Regex online miễn phí. Xử lý hoàn toàn trong trình duyệt, không gửi dữ liệu lên server. Giao diện đơn giản, kết quả nhanh, không cần tài khoản.

Search Reference

49 of 49 tokens
.
Any character

Matches any single character except newline (unless s flag is set).

\d
Digit

Matches any digit character (0-9). Equivalent to [0-9].

\D
Non-digit

Matches any character that is not a digit. Equivalent to [^0-9].

\w
Word character

Matches any alphanumeric character plus underscore. Equivalent to [a-zA-Z0-9_].

\W
Non-word character

Matches any character that is not a word character. Equivalent to [^a-zA-Z0-9_].

\s
Whitespace

Matches any whitespace character: space, tab, newline, carriage return, form feed.

\S
Non-whitespace

Matches any character that is not whitespace.

[abc]
Character set

Matches any one of the characters inside the brackets.

[^abc]
Negated set

Matches any character NOT inside the brackets.

[a-z]
Character range

Matches any character in the specified range (inclusive).

[a-zA-Z]
Combined range

Matches any uppercase or lowercase letter using combined ranges.

[0-9a-fA-F]
Hex digit range

Matches hexadecimal characters by combining digit and letter ranges.

^
Start of string

Matches the start of a string (or line in multiline mode).

$
End of string

Matches the end of a string (or line in multiline mode).

\b
Word boundary

Matches the position between a word character and a non-word character.

\B
Non-word boundary

Matches any position that is NOT a word boundary.

*
Zero or more

Matches the preceding element zero or more times (greedy).

+
One or more

Matches the preceding element one or more times (greedy).

?
Zero or one

Matches the preceding element zero or one time (optional).

{n}
Exactly n

Matches the preceding element exactly n times.

{n,}
n or more

Matches the preceding element at least n times (greedy).

{n,m}
Between n and m

Matches the preceding element between n and m times (inclusive, greedy).

*?
Lazy zero or more

Matches zero or more times, but as few as possible (lazy/non-greedy).

+?
Lazy one or more

Matches one or more times, but as few as possible (lazy/non-greedy).

??
Lazy zero or one

Matches zero or one time, preferring zero (lazy/non-greedy).

(abc)
Capturing group

Groups multiple tokens together and captures the matched text for back-referencing.

(?:abc)
Non-capturing group

Groups tokens together without capturing. Useful for applying quantifiers to groups.

(?<name>abc)
Named group

Captures the matched text and assigns it a name for easier reference.

\1
Backreference

Matches the same text as previously captured by the nth capturing group.

(a|b)
Group alternation

Captures one alternative from inside a group. Combines grouping with alternation.

|
Alternation (OR)

Matches the expression before or after the pipe. Acts as a boolean OR.

\\
Escaped backslash

Matches a literal backslash character.

\n
Newline

Matches a line feed character (LF, U+000A).

\t
Tab

Matches a horizontal tab character (U+0009).

\r
Carriage return

Matches a carriage return character (CR, U+000D).

\.
Escaped dot

Matches a literal period/dot character.

\^
Escaped caret

Matches a literal caret character.

\$
Escaped dollar

Matches a literal dollar sign character.

\(
Escaped parenthesis

Matches a literal opening parenthesis.

g
Global

Find all matches rather than stopping after the first match.

i
Case-insensitive

Makes the entire pattern case-insensitive.

m
Multiline

Makes ^ and $ match the start/end of each line rather than the whole string.

s
Dotall (single-line)

Makes the dot (.) match newline characters as well.

u
Unicode

Enables full Unicode matching. Required for proper emoji and surrogate pair handling.

y
Sticky

Matches only at the index indicated by the lastIndex property. Does not search forward.

(?=abc)
Positive lookahead

Asserts that what follows the current position matches the pattern, without consuming characters.

(?!abc)
Negative lookahead

Asserts that what follows the current position does NOT match the pattern.

(?<=abc)
Positive lookbehind

Asserts that what precedes the current position matches the pattern, without consuming characters.

(?<!abc)
Negative lookbehind

Asserts that what precedes the current position does NOT match the pattern.

Live Sandbox

//g
Flags
No matches found

Common Patterns

Was this tool helpful?

Cách sử dụng

Hướng dẫn sử dụng Cú Pháp Regex:

  1. Mở công cụ: Truy cập trang Cú Pháp Regex trên DevToolkit. Giao diện tải nhanh và sẵn sàng sử dụng ngay mà không cần đăng ký tài khoản hay cài đặt phần mềm bổ sung nào.
  2. Nhập dữ liệu: Dán, gõ hoặc tải file dữ liệu đầu vào. Công cụ tự động nhận diện định dạng và hiển thị giao diện phù hợp. Hỗ trợ Unicode đầy đủ bao gồm tiếng Việt có dấu và emoji.
  3. Tùy chỉnh: Điều chỉnh các tham số và tùy chọn xử lý. Mỗi cài đặt đi kèm tooltip giải thích. Giá trị mặc định đã được tối ưu cho trường hợp sử dụng phổ biến nhất, thay đổi tùy nhu cầu.
  4. Xem kết quả: Kết quả hiển thị ngay lập tức hoặc sau vài giây tùy độ phức tạp dữ liệu. Giao diện phân chia rõ ràng giữa đầu vào và đầu ra để dễ so sánh và kiểm tra tính chính xác.
  5. Sao chép hoặc tải: Sao chép kết quả vào clipboard bằng một nhấp chuột hoặc tải file đầu ra. Kết quả tương thích với các công cụ và phần mềm chuyên nghiệp, sẵn sàng sử dụng ngay.

Về công cụ này

Công cụ Cú Pháp Regex của DevToolkit cung cấp giải pháp xử lý chuyên biệt trong lĩnh vực tham khảo. Giao diện thiết kế tối ưu cho tốc độ làm việc với layout chia đôi (đầu vào bên trái, kết quả bên phải) cho phép so sánh trực tiếp và kiểm tra kết quả ngay lập tức.

Thuật toán xử lý sử dụng các thư viện mã nguồn mở đã được cộng đồng lập trình quốc tế kiểm chứng rộng rãi. Kết quả tương đương với công cụ dòng lệnh và phần mềm chuyên nghiệp. Hỗ trợ dữ liệu Unicode đầy đủ bao gồm tiếng Việt có dấu, chữ CJK, Ả Rập và emoji.

Toàn bộ xử lý diễn ra trong trình duyệt, không gửi dữ liệu ra bên ngoài. Điều này đặc biệt quan trọng khi làm việc với code proprietary, dữ liệu khách hàng hoặc thông tin cấu hình nhạy cảm. Không cần đăng ký tài khoản, không giới hạn số lần sử dụng, và không có quảng cáo trong vùng công cụ.

Tại sao nên dùng

Lý do sử dụng Cú Pháp Regex trên DevToolkit:

  • Miễn phí không giới hạn: Sử dụng bao nhiêu lần tùy ý mà không cần đăng ký, không quảng cáo trong vùng công cụ, không watermark trên kết quả. Thay thế phần mềm trả phí cho các tác vụ tham khảo thường xuyên.
  • Hoạt động mọi nơi: Chạy trên mọi thiết bị có trình duyệt web hiện đại: máy tính Windows/Mac/Linux, tablet iPad/Android và điện thoại. Không cần cài đặt hay tải ứng dụng, truy cập và sử dụng ngay.
  • Xử lý cục bộ an toàn: Dữ liệu không rời khỏi thiết bị trong suốt quá trình xử lý. Không upload, không log, không thu thập thông tin. An toàn cho dữ liệu nhạy cảm, code proprietary và thông tin cá nhân.
  • Tốc độ phản hồi nhanh: Xử lý trực tiếp trên CPU/GPU thiết bị, không phụ thuộc tốc độ mạng hay hàng đợi máy chủ. Kết quả hiển thị trong mili-giây đến vài giây tùy độ phức tạp dữ liệu đầu vào.
  • Giao diện trực quan: Thiết kế tối giản, dễ sử dụng ngay lần đầu không cần hướng dẫn. Tooltip giải thích từng tùy chọn. Phím tắt bàn phím cho người dùng thường xuyên. Chế độ sáng/tối tự động theo hệ thống.

Câu hỏi thường gặp

Nội dùng Cẩm Nang Regex được cập nhật thường xuyên không?
Cẩm Nang Regex được cập nhật mỗi lan phát hanh. Dữ liệu regex cheatsheet lay tu đặc tả chinh thuc. Bao cao thông tin cũ qua nút phản hồi.
Có thể tim nhanh trong Cẩm Nang Regex không?
Có. Chuc nang tìm kiếm của Cẩm Nang Regex loc ngay bằng regex cheatsheet. Hỗ trợ regex cho tìm kiếm nang cao. Kết quả được tô sáng để nhận diện nhanh.
Có thể sao chép lenh tu Cẩm Nang Regex không?
Có. Mỗi muc trong Cẩm Nang Regex có nút sao chép riêng cho regex cheatsheet. Một clic chuyển cú pháp chính xác vào clipboard. Biểu tượng đổi sang dấu kiểm xác nhận.
Cẩm Nang Regex có xem được offline không?
Có. Cẩm Nang Regex là trang tinh không phụ thuộc server. Luu trang (Ctrl+S) để truy cap toan bo regex cheatsheet khi offline. Công cụ hoạt động hoàn toàn trong trình duyệt, không gửi dữ liệu ra ngoài.
Có thể gop y cho Cẩm Nang Regex không?
Có. Dung nút phản hồi trong Cẩm Nang Regex để gui gop y ve regex cheatsheet. Dòng gop được xem xet và tich hop. Dự án mã nguồn mở trên GitHub.