---
title: "Regex Tester | iamthana"
description: "ทดสอบ regular expression กับข้อความ ไฮไลต์ส่วนที่ตรงและแสดงตำแหน่งกับกลุ่มที่จับได้ของแต่ละรายการ"
canonical_url: "https://iamthana.com/tools/regex-tester"
meta:
  "og:description": "ทดสอบ regular expression กับข้อความ ไฮไลต์ส่วนที่ตรงและแสดงตำแหน่งกับกลุ่มที่จับได้ของแต่ละรายการ"
  "og:image": "https://iamthana.com/_og/s/o_618148cf35a61e9f.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Regex Tester | iamthana"
  "twitter:image": "https://iamthana.com/_og/s/o_618148cf35a61e9f.png"
---

> Index of every page on this site: [llms.txt](https://iamthana.com/llms.txt)

# **Regex Tester**

ทดสอบ regular expression กับข้อความ ไฮไลต์ส่วนที่ตรงและแสดงตำแหน่งกับกลุ่มที่จับได้ของแต่ละรายการ

**Pattern**

//g

แฟล็ก

**ข้อความทดสอบ**0 ตัวอักษร

ใส่ pattern กับข้อความทดสอบ ผลลัพธ์จะขึ้นที่นี่ทันที

## **อ่านผลลัพธ์**

ตำแหน่งนับจาก 0 ตามหน่วย UTF-16 ของ JavaScript เหมือน match.index ตัวเลขหลังคือตำแหน่งที่อยู่ถัดจากตัวสุดท้าย ช่วง 12-15 จึงหมายถึงอักขระที่ 12 ถึง 14 อีโมจิทั่วไปใช้สองหน่วย ส่วนอีโมจิที่ประกอบจากหลายตัวใช้มากกว่านั้น

กลุ่มที่ตั้งชื่อ (named group) จะแสดงชื่อพร้อมเลขลำดับ กลุ่มที่อยู่ในทางเลือกที่ไม่ถูกใช้จะขึ้นว่าไม่ได้จับคู่ ซึ่งต่างจากกลุ่มที่จับได้ข้อความว่าง

ผลลัพธ์แสดงสูงสุด 1,000 รายการแรก และข้อความที่ไฮไลต์แสดง 100,000 ตัวอักษรแรก ถ้า pattern ใช้เวลาเกิน 0.5 วินาที การทดสอบจะหยุดเพื่อไม่ให้หน้าค้าง

## **แฟล็ก**

<dl><dt>**d**</dt>
<dd>เก็บช่วงตำแหน่งของแต่ละกลุ่มไว้ในผลลัพธ์ หน้านี้แสดงช่วงตำแหน่งให้เสมอ ไม่ว่าจะเปิดแฟล็กนี้หรือไม่</dd>
<dt>**g**</dt>
<dd>หาทุกรายการที่ตรง ถ้าปิดจะได้เฉพาะรายการแรก</dd>
<dt>**i**</dt>
<dd>ไม่แยกตัวพิมพ์เล็กกับตัวพิมพ์ใหญ่</dd>
<dt>**m**</dt>
<dd>^ กับ $ จับต้นและท้ายของทุกบรรทัด ถ้าปิดจะจับแค่ต้นและท้ายของทั้งข้อความ</dd>
<dt>**s**</dt>
<dd>จุด (.) จับอักขระขึ้นบรรทัดใหม่ด้วย</dd>
<dt>**u**</dt>
<dd>อ่าน pattern เป็นอักขระ Unicode เต็มตัว อีโมจิที่เป็นอักขระเดี่ยวนับเป็นหนึ่งอักขระ และ escape ที่ไม่ถูกต้องจะเป็นข้อผิดพลาด</dd>
<dt>**v**</dt>
<dd>ทำงานแบบ u และเพิ่มไวยากรณ์ชุดอักขระ เช่นการลบกันด้วย -- ใช้พร้อมกับ u ไม่ได้</dd>
<dt>**y**</dt>
<dd>จับเฉพาะตรงตำแหน่ง lastIndex ซึ่งเริ่มที่ 0 ถ้าใช้คู่กับ g จะได้เฉพาะรายการที่ต่อเนื่องกันตั้งแต่ต้น</dd></dl>

## **เครื่องมืออื่น ๆ**

- [Developer

  3f2b8c1e-9a4d-4e7b-

  8c5a-1d6f0e2b7a94<h3>**UUID Generator**</h3>

  สร้างรหัส UUID เวอร์ชัน 1, 4, 6 และ 7 ครั้งละไม่เกิน 1,000 รายการ เลือกตัวพิมพ์ใหญ่หรือตัดขีดคั่นได้](https://iamthana.com/tools/uuid-generator)
- [Developer<h3>**สร้าง QR Code ฟรี ไม่หมดอายุ (QR Code Generator)**</h3>

  สร้าง QR Code จากลิงก์หรือข้อความ ดาวน์โหลดเป็น PNG หรือ SVG ได้ฟรี รหัสเก็บข้อมูลไว้ในตัวเองจึงไม่หมดอายุ](https://iamthana.com/tools/qr-generator)
- [Developer

  \*/15 9-17 \* \* 1-5

  ทุก 15 นาที 09:00 ถึง 17:45 จันทร์ถึงศุกร์<h3>**Cron Job Generator**</h3>

  สร้างนิพจน์ cron สำหรับตั้งเวลางานอัตโนมัติ ตั้งทีละช่องหรือพิมพ์เอง พร้อมคำอธิบายเป็นภาษาไทยและรอบที่จะรันถัดไป](https://iamthana.com/tools/cron-generator)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://iamthana.com/#website","@type":"WebSite","inLanguage":"th-TH","name":"iamthana","url":"https://iamthana.com/","publisher":{"@id":"https://iamthana.com/#identity"},"workTranslation":[]},{"@id":"https://iamthana.com/tools/regex-tester#webpage","@type":"WebPage","description":"ทดสอบ regular expression กับข้อความ ไฮไลต์ส่วนที่ตรงและแสดงตำแหน่งกับกลุ่มที่จับได้ของแต่ละรายการ","name":"Regex Tester","url":"https://iamthana.com/tools/regex-tester","breadcrumb":{"@id":"https://iamthana.com/tools/regex-tester#breadcrumb"},"isPartOf":{"@id":"https://iamthana.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://iamthana.com/tools/regex-tester"]}]},{"@id":"https://iamthana.com/#identity","@type":"Person","alternateName":"Thana Tingprasom","name":"iamthana","url":"https://iamthana.com","knowsAbout":["AI","SEO","Development","Homelab","Software Development","Python","Ubuntu","Docker"],"sameAs":["https://github.com/iamthana","https://www.linkedin.com/in/thana-tingprasom/","https://www.facebook.com/kttkook"]},{"@id":"https://iamthana.com/tools/regex-tester#webapplication","@type":"WebApplication","applicationCategory":"UtilityApplication","applicationSubCategory":"Developer","browserRequirements":"Requires JavaScript","description":"ทดสอบ regular expression กับข้อความ ไฮไลต์ส่วนที่ตรงและแสดงตำแหน่งกับกลุ่มที่จับได้ของแต่ละรายการ","inLanguage":"th-TH","isAccessibleForFree":true,"name":"Regex Tester","operatingSystem":"Any","url":"https://iamthana.com/tools/regex-tester","author":{"@id":"https://iamthana.com/#identity"},"offers":{"@type":"Offer","price":"0","priceCurrency":"THB"}},{"@id":"https://iamthana.com/tools/regex-tester#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://iamthana.com","position":1},{"@type":"ListItem","name":"Tools","item":"https://iamthana.com/tools","position":2},{"@type":"ListItem","name":"Regex Tester","position":3}]}]}
```

## Sitemap

See the full [sitemap](https://iamthana.com/sitemap.md) for all pages.
