Skip to content

Instantly share code, notes, and snippets.

@pixelkritzel
Created February 24, 2016 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pixelkritzel/950cfe41d2e138813f7d to your computer and use it in GitHub Desktop.
Save pixelkritzel/950cfe41d2e138813f7d to your computer and use it in GitHub Desktop.
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