Skip to content

Instantly share code, notes, and snippets.

@YasirGaji
Created February 23, 2022 09:48
Show Gist options
  • Save YasirGaji/a21899d7ef10dbe818a9f03b8431e6bb to your computer and use it in GitHub Desktop.
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
// 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