Created
February 24, 2016 14:41
-
-
Save pixelkritzel/950cfe41d2e138813f7d to your computer and use it in GitHub Desktop.
Extract keys from string without delimiter
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
const str = '__key__dfdsafadf[__index__]kjjkl' | |
const regx = /__(\w+)__/g | |
let keys = []; | |
let res; | |
while((res = regx.exec(str)) !== null) { console.log( keys.push(res[1]) ) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment