In this article we are going to talk about Regex and URL validation. We will be going over everthing from Anchors to Character Escapes and the examples are in JavaScript.
If Regex is new to you. Regex is used in many programming languages to distinguish patterns within strings. Each character in Regex is used to represent a pattern within the string being searched. Patterns are made up of normal and special characters. Normal characters like abc 123
represent themselves while special characters like /.$
have special meaning.
For example, the following code will check if a string is exactly abc.