Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Extract keys from string without delimiter
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
You can’t perform that action at this time.