Last active
April 12, 2019 07:31
-
-
Save Peter-Hudson/fce8655dc527a0ed013c80760cc70c82 to your computer and use it in GitHub Desktop.
There has to be a better version of this? Though I did this without searching the answer.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let testString = 'aaabbbbaa'; | |
testString.match(/.+?(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+)/igm).map(c => c.length + c[1]).join(''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment