Skip to content

Instantly share code, notes, and snippets.

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