Don’t just use it. Understand it.
Regex without the
guesswork.
Test patterns, see their structure, document the tricky parts, and share a durable workspace with your team.
See the structureBrowser-rendered railroad diagrams
Explain the whyNotes beside every pattern
Share a workspaceOne link your whole team can open
29 practical patterns
A library for the regex you actually write.
01
url
A valid URL with http/https
$ pattern
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_\+.~#?&\/\/=]*)/gmurlhttphttps
02
url slug
A ‘slug' is the part that comes at the very end of a URL, and refers to a specific page or post. Usually a combination of word that separated with hyphen
$ pattern
/^[a-z0-9]+(?:-[a-z0-9]+)*$/gmslugurllink