Skip to content

Instantly share code, notes, and snippets.

@YasirGaji
Created February 22, 2022 16:38
Show Gist options
  • Save YasirGaji/e160d3caac7bfb80ed89b1759c7c9e5f to your computer and use it in GitHub Desktop.
Save YasirGaji/e160d3caac7bfb80ed89b1759c7c9e5f to your computer and use it in GitHub Desktop.
This script shows how to valuate a regular expression using the "match()" function for the "Regular Expressions in Javascript" article by Yasir Gaji
// VALUATING THE REGULAR EXPRESSION USING THE "match()" FUNCTION
const stillTheFirstWay = /words between slahses/; //declared regular expression
const thePassingStatement = 'this is a sentence with words between slahses being evaluated with the match() function';
const theResult = thePassingStatement.match(stillTheFirstWay);
console.log(theResult);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment