A Regular Expression (shortened as 'regex' or 'regexp') is a sequence of characters that defines a specific search patten in text. Most general-purpose programming launguages support regex capabilities either natively or via libraries, including for example JavaScript, Python, C, C++ and Java.
In this Gist, Let's break down the regex for matching a URL and take a look at each component.
- Matching a URL :
/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/