Skip to content

Instantly share code, notes, and snippets.

View ahmadelgamal's full-sized avatar

Ahmad El Gamal ahmadelgamal

View GitHub Profile
@ahmadelgamal
ahmadelgamal / regex-tutorial.md
Last active December 19, 2023 14:56
Regex Tutorial

Regex Tutorial

This tutorial is a quick-reference for common regular expressions, or regex, components, and how to use them.

Summary

Regular expressions are used to validate input by searching for (matching) specific patterns in a given string. This is helpful in many applications, such as to check if an email input is the correct format of an email, or if a user enters a URL that matches the correct format of a URL, etc.

Although they may seem confusing at first, with practice they become easy to work with and can be very powerful in making your code less succeptible to user error.