Created
February 23, 2022 09:48
-
-
Save YasirGaji/a21899d7ef10dbe818a9f03b8431e6bb to your computer and use it in GitHub Desktop.
This script shows how the skip "." and global "g" flag functions on a regular expression 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
// THE SKIP FLAG DEMONSTRATION | |
const skipFlagStatement = /Y.sir/g; //declaring a regular expression with the skip and global flag | |
const thePassingStatement = 'Yasir, Yusir, and Ynsir is allowed thanks to the skip flag which permits any letter inplace of the flag character'; | |
const theResult = thePassingStatement.match(skipFlagStatement); // valuating... | |
console.log(theResult); // returning the result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment