Skip to content

Instantly share code, notes, and snippets.

@ties
Created April 24, 2018 13:07
Show Gist options
  • Select an option

  • Save ties/9568a6d32d6267823c3ca26f4a7790e8 to your computer and use it in GitHub Desktop.

Select an option

Save ties/9568a6d32d6267823c3ca26f4a7790e8 to your computer and use it in GitHub Desktop.
/**
* Regular expressions in javascript...
*
* Given that
*/
'abc'.match(new RegExp('ab.'));
// returns what is logged by
console.log([ 'abc', index: 0, input: 'abc' ])
// and
'abc'.match(new RegExp('mis'))
// =>
console.log(null)
// What is the result of:
'abc'.match(new RegExp('ab\.'))
// and:
'abc'.match(new RegExp(/ab\./))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment