Skip to content

Instantly share code, notes, and snippets.

@kurt-liao
Last active August 24, 2022 08:34
Show Gist options
  • Save kurt-liao/e1d768a7a6a3742bfd82066ad29077b5 to your computer and use it in GitHub Desktop.
Save kurt-liao/e1d768a7a6a3742bfd82066ad29077b5 to your computer and use it in GitHub Desktop.
const str = 'bbabcddd'
const regex = /(abc)/gd;
const matched = regex.exec(str);
console.log(matched);
// [
// "abc",
// "abc",
// groups: undefined,
// index: 2,
// indices: [
// [2, 5],
// [2, 5],
// groups: undefined
// ],
// input: "bbabcddd"
// ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment