Skip to content

Instantly share code, notes, and snippets.

View miss-mad's full-sized avatar
🎯
Focusing

Madeleine miss-mad

🎯
Focusing
View GitHub Profile

Regex Tutorial: Matching a URL

What is a Regex?

Regex stands for "regular expression" and is a way to search for existing patterns within text. It is not language-specific, meaning that it can be used to find patterns within JavaScript, Python, Ruby, C++, etc. These expressions actually don't have to do with programming at all; they can be useful for general find-and-replace searches in a file. For programming, regex is often used for form or input validation.

There are literal and meta characters:

Literal characters are what we see - what is literally written, like "github.com."

Meta characters are ones that do not depict a single, literal character, but a generalized pattern.