Look up a ready-made regular expression for common patterns like email addresses, IP addresses, or usernames without writing one from scratch.
Understand a confusing regular expression by viewing its visual breakdown into named parts.
Contribute a new regex pattern to the site by adding an entry to the JSON data file with test strings and an optional explanation.
iHateRegex is the source code for ihateregex.io, a website that helps people understand and use regular expressions without needing to already know how they work. Regular expressions are a compact notation used in programming to search for patterns in text, and they are notoriously hard to read. This site makes them more approachable by showing a visual diagram of what each part of an expression does, alongside a testing area where you can see which strings it matches. The site works as a cheat sheet and a reference library. Each entry in the collection has a title (like "username" or "email address" or "IP address"), a short description of what it matches, the actual expression, and a visual breakdown of the expression's structure. You can also embed the diagram directly into your own website or blog post. The project is built with Nuxt.js, which is a framework for building web applications with Vue. To run it locally, you install the dependencies with yarn and then start a development server. The regex definitions are stored as JSON files in a static folder, which makes it easy to add new entries without touching any application code. Contributing a new regex is straightforward: you add an entry to the data.json file with the expression and some test strings, and optionally create a markdown file with a longer explanation of how the expression works. The project welcomes outside contributions and the process is well documented in the README. The visual diagram component is built on top of an open-source tool called Regexper, which converts regular expressions into railroad diagrams. The rest of the interface was built by the project's author.
← geongeorge on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.