Skip to content

Instantly share code, notes, and snippets.

View SmithBWare89's full-sized avatar

Stephon Smith SmithBWare89

  • 18:17 (UTC -04:00)
View GitHub Profile
@SmithBWare89
SmithBWare89 / regex-url-matching.md
Last active December 7, 2021 19:40
RegEx - URL Matching

RegEx - URL Matching

Regular Expresions, or regex, are powerful and useful tools in web development and coding because the data that can be drawn from them can be used in multiple ways to enhance and simplify certain processes in regards to coding. The gist of this gist is to be able to break down what goes into the creation of a regex as well as identify how powerful this tool can be in capturing and validating the data we receive from users on the front end.

Summary

Briefly summarize the regex you will be describing and what you will explain. Include a code snippet of the regex. Replace this text with your summary.

While it may not be a common occurence, there may be times where a user will be asked to provide a link for a myriad of reasons. The purpose of the regex provided is to ensure that the URL provided follows the standard practices for formatting a URL. Take a look at the code snippet below and then attempt to explain to yourself in plain English what each component is performing. If you're

// Closed Form Solution
let n = parseInt(process.argv[2]);
let phi = (1 + Math.sqrt(5)) / 2;
let psi = 1 - phi;
let solution = (Math.pow(phi, n) - Math.pow(psi, n)) / Math.sqrt(5);
console.log(solution.toFixed(0));
// Linear Approach
const linear = num => {
// Implement the Fibonacci algorithm using the linear approach