explaingit

gskinner/regexr

10,333JavaScriptAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

The source code behind regexr.com, an interactive website where you write a regex pattern and see matches highlight in real time, with hover explanations for every part of the expression.

Mindmap

mindmap
  root((regexr))
    What it does
      Live regex testing
      Match highlighting
      Hover explanations
    Features
      JavaScript flavor
      PCRE PHP flavor
      Community patterns
      Save and share URL
    Self-hosting
      Node.js
      Gulp build tool
    Audience
      Web developers
      Learning regex
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Test and debug a regular expression pattern against sample text and see exactly which parts match in real time.

USE CASE 2

Learn what each piece of a complex regex pattern does by hovering over it for an inline explanation.

USE CASE 3

Self-host RegExr on your company intranet so developers can use it without sending proprietary text to an external site.

USE CASE 4

Browse and reuse community-submitted regex patterns for common tasks like email validation or URL parsing.

Tech stack

JavaScriptNode.jsGulp

Getting it running

Difficulty · easy Time to first run · 5min

The live site at regexr.com needs no setup, self-hosting requires Node.js and running the default Gulp task to start a dev server.

Free to use and modify under GPL v3, if you need a commercial license without the GPL terms, contact the authors.

In plain English

RegExr is the source code for the website at regexr.com, an online tool for working with regular expressions. A regular expression is a pattern written in a small, specialized syntax that lets you search, match, and manipulate text in precise ways. They appear in almost every programming language, but the syntax can be hard to learn without a way to test patterns interactively. The site lets you type a regular expression in one panel and some sample text in another, and it highlights the matches in real time as you type. Hovering over part of the expression or a match shows an explanation of what that part does, which helps with understanding what went wrong when a pattern does not behave as expected. The tool supports two flavors of regular expression: JavaScript and PHP/PCRE, which are common in web development. Beyond basic matching, RegExr includes a reference section with examples, a Tools panel for inspecting results in different ways, undo and redo support in the editors, and the ability to save and share a particular expression via a URL. There is also a community library of patterns that other users have submitted, which you can search and rate. The README notes that this is the codebase behind the hosted website. If you want to run it yourself, it uses Node.js and a build tool called Gulp. Running the default Gulp task starts a local development server. The project is licensed under GPL v3, and the README mentions the option to contact the authors if you need different licensing terms.

Copy-paste prompts

Prompt 1
I need a regex that matches a valid email address but not ones with two consecutive dots. Open RegExr logic for me and write the pattern along with test cases.
Prompt 2
Help me write a JavaScript regex using RegExr-compatible syntax that extracts all ISO 8601 dates from a block of text, including optional time components.
Prompt 3
I want to self-host RegExr. Write the steps to clone the repo, install dependencies, and start the local development server using Gulp.
Prompt 4
What is the difference between the JavaScript and PHP/PCRE regex flavors supported by RegExr, and when does it matter which one I use?
Open on GitHub → Explain another repo

← gskinner on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.