Skip to content

Instantly share code, notes, and snippets.

@OneFJef
OneFJef / url-validation.md
Created October 31, 2021 21:10
URL Validation with Regex

URL Validation with Regex

A regular expression is a sequence of characters that specifies a search pattern. Usually such patterns are used by string-searching algorithms for "find" or "find and replace" operations on strings, or for input validation.

Summary

This guide will go over how /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/ is used to validate a URL address.

Table of Contents