⁂ Regex Generator
Describe in plain words what you need to match and get a correct regex — broken down token by token, with matching and non-matching examples.
- Correct, not clever. Robust patterns that prioritize accuracy over one-liners.
- Explained token by token. You learn why it works, not just what to paste.
- Tested both ways. Example strings that should — and shouldn't — match.
See the quality — a real example
Sample only · no credits usedInput — what to match
A valid hex color like #fff or #ffffff, with the leading # required.
Output — pattern & examples
^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$ Matches
- #fff
- #1a2B3c
Non-matches
- fff
- #12g
Sign in to use this tool
Sign in to use (30 free points on signup). Signed-in users run every tool on their account points — nothing to paste.
Sign in →