regex - How to parse functions names from string using javascript? -


i'm looking reliable way function names string. string values can this:

let str = 'qwe(); asd();zxc()' //or let str = 'qwe("foo");asd(1);zxc();'  //etc. 

i want have array

['qwe', 'asd', 'zxc'] 

i tried str.split(';') how rid of parenthesis , can hold? there regexp match symbols on left of other symbol?

you can use simple regex find function names in .match()

var str = "qwe(); asd();zxc()";  console.log(str.match(/\w+(?=\()/g));


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -