RE without groups vs RE with groups

Edit on GitHub

Setup

var re1 = /a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z/g;
var re2 = /(?:a|b|c|d|e|f|g|h|i|j|k|l|m)|(?:n|o|p|q|r|s|t|u|v|w|x|y|z)/g;

Tests

  • RE without groups

    "the quick brown fox jumped over the lazy dog".match(re1)
  • RE with groups

    "the quick brown fox jumped over the lazy dog".match(re1)