Skip to content

Instantly share code, notes, and snippets.

@kulakowka
Last active July 3, 2017 08:08
Show Gist options
  • Save kulakowka/fce222f684e819ac59fbaee2e941bbb7 to your computer and use it in GitHub Desktop.
Save kulakowka/fce222f684e819ac59fbaee2e941bbb7 to your computer and use it in GitHub Desktop.
Magic by @n4kz
'AAAABBHHJOPPPP'
.replace(/(\w)\1+/g, (match) => match[0] + (match.length));
// => "A4B2H2JOP4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment