Created
February 22, 2022 16:56
-
-
Save YasirGaji/50f693ab0a0d4e6d3d323c082183eff6 to your computer and use it in GitHub Desktop.
This script shows how to valuate a regular expression using the "search()" function for the "Regular Expressions in Javascript" article by Yasir Gaji
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// VALUATING THE REGULAR EXPRESSION USING THE "search()" FUNCTION | |
const stillTheFirstWay = /words between slahses/; //declared regular expression | |
const thePassingStatement = 'this is a sentence with words between slahses being evaluated with the search() function'; | |
const theResult = thePassingStatement.search(stillTheFirstWay); | |
console.log(theResult); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment