Website review
This review may include AI-generated content and is not individually verified. Domain, certificate and other facts come from the observed data on this page.
What is iHateRegex?
iHateRegex is a browser-based regular expression playground that emphasizes understanding patterns rather than just copying them. Its stated aim is "regex without the guesswork": you test a pattern against sample text, see browser-rendered railroad diagrams of its structure, and keep notes explaining why the pattern is written the way it is. It also offers shareable workspaces, so a pattern plus its documentation can be opened by a whole team through one link.
What it includes
- Live matching against your own sample input, with a visible match count and validity indicator.
- Railroad diagrams that visualise how the expression is structured, which helps when reading dense patterns.
- Per-pattern notes for documenting tricky sections and intent.
- A library of practical, ready-to-adapt patterns, such as the simple email pattern
[^@\s]+@[^@\s]+\.[^@\s]+, a stricter "complicated" email variant, username, password, phone number, and IPv4/IPv6 address patterns. - Sharing via a workspace link.
Who it suits
| Reader | Why it fits |
|---|---|
| Developers debugging a pattern | Live matching plus a diagram shows where a match fails or over-captures |
| Teams maintaining shared validation rules | Notes and shareable links keep the reasoning attached to the pattern |
| Learners | Reading structured examples teaches syntax in context |
The trade-off is that this is a working tool, not a formal reference or a guarantee of correctness. Library patterns are starting points: an email regex that "works most of the time" will still reject or accept edge cases, and a password pattern enforces shape, not security. Always test against your own real inputs.
A practical next step: open iHateRegex, pick the closest library pattern, paste in a handful of valid and invalid samples from your application, and add a note recording what you deliberately excluded.
How do I test a regular expression and see its railroad diagram on iHateRegex?
Paste your pattern into the editor at iHateRegex, add sample text, and watch matches highlight as you type. The railroad diagram sits alongside the pattern, so you can trace how each group, quantifier and alternation is interpreted without leaving the page.
A quick workflow
- Open the site and either start a blank pattern or load one from the built-in library (it lists practical patterns such as username, password, email, phone number and IPv4/IPv6).
- Type or paste your expression into the pattern field. Choose the flags you need — the library examples show
g,mandiin use. - Put representative input in the test area, including both strings that should match and strings that should not.
- Read the highlighted matches and the match count, then inspect the railroad diagram to see which branch of the expression produced the result.
- Use the notes field to record why the pattern is written that way, and share the workspace link if a colleague needs the same context.
When the diagram earns its keep
Railroad diagrams are most useful for nested or alternation-heavy patterns. The IPv6 example in the library is a good illustration: a wall of | branches becomes a readable set of paths, and you can see which alternative is being taken for a given address. For something short like the simple email pattern [^@ \t\r\n]+@[^@ \t\r\n]+\.[^@ \t\r\n]+, the diagram is less necessary — testing against a handful of addresses tells you most of what you need.
A practical check
Suppose you are validating signup input. Load the password pattern, then test four strings: one valid, one missing an uppercase letter, one missing a digit, and one too short. The match count and highlighting show you immediately which rules are doing the work, and the diagram shows how the lookaheads are chained. If a string you expected to fail still matches, the diagram usually reveals which optional section allowed it.
Next step: keep the notes field honest. A pattern you cannot explain six months later is a pattern you will rewrite by accident.
Which ready-made regex patterns are available in the iHateRegex library?
The library covers 29 practical patterns aimed at the checks developers write most often. From the page evidence, the listed entries include:
- username —
^[a-z0-9_-]{3,15}$ - password — minimum eight characters with upper case, lower case, a number and a special character
- email simple — a permissive pattern that "works most of the times"
- email complicated — a stricter pattern the site itself calls unnecessarily complicated
- phone number — optional country code, with
-, spaces or dots as separators - IP address (IPv4)
- IP address (IPv6)
Each entry pairs the pattern with a short description, so you can judge intent before copying. The library is searchable, and the surrounding workspace adds browser-rendered railroad diagrams, notes next to a pattern, and a shareable link for a team.
Practical next step
Pick the pattern closest to your input, then test it against your own edge cases rather than trusting the label. The simple email pattern is a good fit for form-level sanity checks; the complicated one is worth reading only if you genuinely need stricter validation, and its own description warns against over-trusting it. For phone and IP formats, confirm your expected separator and version conventions against the pattern before shipping.
If you maintain a pattern your team keeps re-deriving, use the notes and share features to document the tricky parts — that is the difference between a snippet and a reference the next person can use.
How can I share a regex workspace with my team using iHateRegex?
Use the Share a workspace feature: iHateRegex generates a single link that opens your saved regex setup for anyone you send it to. The shared view covers the pattern itself, the live test input and matches, the browser-rendered railroad diagram, and your written notes explaining the tricky parts. That makes it a handoff document rather than just a pasted expression.
H3 Practical scenario You write the email validation pattern, add test strings that must pass and must fail, and annotate why the character class excludes whitespace. A teammate opens the link, sees the same matches and the diagram, and can judge the pattern without installing anything or asking you to re-explain it.
H3 How to get a useful result
- Add notes before sharing: the diagram shows structure, but the notes carry intent, known edge cases and why you rejected an alternative.
- Include both matching and non-matching samples so the recipient can see the boundaries, not just a green result.
- Treat the link as a snapshot for review and discussion; if the pattern changes later, share the updated workspace rather than assuming the old link reflects the new version.
H3 Trade-offs A shared workspace is fast and readable, but it is a link, not a versioned artifact in your repository. For long-lived rules, keep the final pattern in code with a comment and use the shared link only for the review conversation. Also remember that a library pattern is a starting point: the email and password examples are deliberately generic, and your own validation rules should decide what actually counts as valid.
H3 Next step Open the pattern you want to discuss, add your notes and test cases, then share the workspace link in the pull request or team chat and ask one specific question, such as whether the phone number pattern should accept extensions.
For teams that prefer a code-first workflow, a general-purpose tester like Regex101 keeps explanation and matching in one place, while RegExr is handy for quick community-style reference. iHateRegex's distinguishing value is the combination of railroad diagrams, side notes and a single shareable link.
How do I add notes to explain a regex pattern on iHateRegex?
Notes live beside the pattern in the editor. Write your explanation in the notes area next to the regular expression, and it stays attached to that pattern in your workspace.
Practical workflow
- Open or create the pattern you want to document.
- Paste the regex into the pattern field and check the live matches.
- Use the notes area to explain the parts that are easy to forget—why a lookahead is there, what an edge case covers, which input broke an earlier version.
- Share the workspace link so teammates see the pattern and your notes together, rather than a bare expression in a chat message.
What good notes look like
- Intent: "Rejects addresses without a dot in the domain."
- Known trade-off: "Simple version; will accept some invalid addresses."
- Change history: "Tightened in March to require a TLD of at least two letters."
H3. When this matters If you are the only person who will ever read the regex, a one-line comment may be enough. Notes earn their keep on shared patterns—email validation, phone formats, log parsing—where the next reader is a teammate or your future self. Keep each note tied to a specific part of the pattern instead of restating the whole expression.
Next step: open one of the library patterns closest to your use case, adapt it, and write your notes before sharing the link.
What is the difference between the simple and complicated email regex patterns on iHateRegex?
The simple pattern is deliberately permissive: it matches anything shaped like [email protected], with no spaces or extra @ signs. The complicated pattern tries to validate the local part and domain more strictly, including quoted local parts and IP-literal domains.
| Simple email pattern | Complicated email pattern | |
|---|---|---|
| What it checks | One @, no spaces, at least one dot after the @ |
Character-by-character rules for the local part and domain |
| Typical use | Quick form sanity checks, log scanning, extracting addresses from text | Stricter input validation where you can tolerate false rejections |
| Failure mode | Accepts things like [email protected] and some malformed addresses |
Rejects valid but unusual addresses, and is hard to maintain |
| Readability | Easy to read and adjust | Long enough that most people won't verify it by eye |
On iHateRegex, the simple version is labeled as working "most of the times," while the complicated one is described as "unnecessarily complicated" and working "more than" most of the times — a hint that the extra complexity buys limited real-world accuracy. The site also shows railroad diagrams and notes beside each pattern, which is where the difference becomes obvious: the simple pattern is a few short branches, and the complicated one is a large tree you would not want to debug from memory.
A practical next step: pick the simple pattern for extraction and client-side hints, and rely on a confirmation email or a server-side library for actual validation. If you do need the strict version, test it against a list of real addresses — including plus-addressing, subdomains and quoted local parts — before shipping it. You can compare both side by side at iHateRegex.
User reviews (0)