# Regex Playground

> **Purpose:** A live, interactive regular expression tester. Type a pattern on the left and watch matches highlight in the test string in real time. Includes named group extraction, match count, a library of common presets, and flag toggles (g, i, m, s).

---

## How to Use

1. **Type a pattern** in the `/pattern/` input at the top
2. **Toggle flags** — `g` (global), `i` (case-insensitive), `m` (multiline), `s` (dotAll)
3. **Edit the test string** — paste any text to test against
4. **Click a preset** in the right panel to load a common pattern instantly

---

## Preset Patterns Included

| Preset | Pattern matches |
|--------|----------------|
| Email | Standard email addresses |
| URL | HTTP and HTTPS URLs |
| UUID | RFC 4122 UUIDs |
| Hex Color | CSS hex colors (#fff, #7c3aed) |
| ISO Date | YYYY-MM-DD date strings |
| IP Address | IPv4 addresses |
| Phone (US) | US phone numbers with country code |
| Markdown Link | `[text](url)` link syntax |

---

## Reading Results

- **Purple highlight** — a match in the test string
- **Brighter purple** — the first match
- **Match list** — shows each match text and its character index
- Named capture groups are shown in the match list as `groups: {name: value}`

---

## Common Flags

| Flag | Meaning |
|------|---------|
| `g` | Global — find all matches, not just the first |
| `i` | Case-insensitive match |
| `m` | Multiline — `^` and `$` match line boundaries |
| `s` | Dotall — `.` matches newlines |
