ตัวจัดรูปแบบและโค้ด
เครื่องมือทดสอบ Regex
เครื่องมือทดสอบ regex ฟรี พร้อมการไฮไลต์แบบเรียลไทม์ เขียน JavaScript regex ดูการจับคู่และกลุ่มการจับภาพอัปเดตขณะที่คุณพิมพ์ กลไกเดียวกับที่เบราว์เซอร์ของคุณใช้
- #1 · index 6ada@example.com
- $1ada
- $2example.com
- #2 · index 25grace.hopper@navy.mil
- $1grace.hopper
- $2navy.mil
Toggle on to write a replacement string and see the result. Use $1, $2, … to reference capture groups.
\dany digit (0-9)\wword character (letters, digits, _)\sany whitespace.any single character*zero or more of the preceding+one or more?optional (0 or 1){n,m}between n and m of the preceding^start of string (or line with m)$end of string (or line with m)[abc]any of a, b, or c[^a-z]anything BUT lowercase a-z(…)capture group(?:…)non-capturing group|alternation (or)
หมายเหตุจากบรรณาธิการ
Understanding · Patterns, not literals.
บทเชิงลึกนี้มีให้บริการเฉพาะภาษาอังกฤษในขณะนี้ เครื่องมือแปลงด้านบนทำงานในภาษาของคุณ บทความอธิบายแบบยาวยังไม่ได้แปล
คำถามที่พบบ่อย
Quick answers.
›Which regex flavor is used?
JavaScript regex (ECMAScript), evaluated by the same engine your browser uses. Matches PCRE for most common patterns but differs on lookbehinds and named groups.
›What flags can I use?
g (global), i (case-insensitive), m (multiline), s (dotAll), u (unicode), y (sticky).
›Are matches highlighted live?
Yes — every keystroke re-runs the regex and updates highlights immediately.
›Are capture groups shown?
Yes. Numbered and named capture groups are listed for each match.
›Is my input sent anywhere?
No — everything runs in your browser. Useful when testing regex against sensitive text.
›Is the regex tester free?
Yes — fully free, no signup.
ผู้คนยังค้นหา
บทความที่เกี่ยวข้อง
จากบล็อก(2)
เครื่องมือที่เกี่ยวข้อง
More in this room.
- Regex Playgroundรูปแบบ Regex ที่คัดสรรแล้วกว่า 100+ แบบพร้อมตัวทดสอบแบบสด
- ตัวแปลง CasecamelCase, snake_case, kebab-case และอื่นๆ
- ตัวตรวจสอบข้อความที่แตกต่างกัน (Text Diff Checker)เปรียบเทียบข้อความสองส่วนทีละบรรทัด
- ตัวนับคำและอักขระนับคำ, อักขระ, ประโยค, เวลาอ่าน
- จัดเรียงบรรทัดจัดเรียงบรรทัดตามตัวอักษร, ความยาว หรือตัวเลข
- ลบบรรทัดที่ซ้ำกันลบบรรทัดที่ซ้ำกันโดยคงลำดับเดิมไว้