Skip to content

Instantly share code, notes, and snippets.

@ceresmarkley
ceresmarkley / URLregex.md
Last active August 31, 2023 00:44
URL Regular Expression (Regex) Tutorial

URL Regex Search Pattern

Hello and Welcome! This is a quick tutorial on a URL regex, also known as a regular expression!

Summary

Regular expressions, or REGEX for short, are a series of special characters that define a search pattern. Take the following example of a regular expression, which we’ll call “Matching a URL”:

/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/