Environment variables are a way to store configuration settings for your applications. They are key-value pairs that are outside of the application code. Although environment variables work in a similar fashion in both frontend and backend applications, there are some specific considerations for each.
Regex (Regular Expressions) are a series of special characters used to define a search pattern. Hex values are typically used to identify colors, though they have other uses as well. This Gist was created to serve as a tutorial for understanding the components of regular expressions!
Hex values are typically used to identify elements such as color. You may have seen them in CSS files or even in the paint section at home improvement stores!
These values begin with a # followed by a mix of six numbers or letters.
I made this cheat sheet with table of contents for easier navigation.
What is regex?
A regex, which is short for regular expression, is a sequence of characters that defines a specific search pattern. When included in code or search algorithms, regular expressions can be used to find certain patterns of characters within a string, or to find and replace a character or sequence of characters within a string. They are also frequently used to validate input. Such as email addresses, URLs, usernames, etc.
- Purpose of the tutorial: This tutorial aims to dissect and explain the components of a specific regular expression (regex) used for URL matching.
This guide was created to help myself and you learn more about regular expressions and how to use them. Regular expressions are special characters that define a search pattern.
The regular expression, or regex for short, below is a search pattern for matching a Url. Since this regular expression is between two slashes it is called a regular expression literal. It is made up of anchors, grouping constructions, bracket expressions, and quantifiers. We will look at each component of the regular expression so they make more sense.
/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/