javascript - Get only the string inside a curly brackets -


i have number of strings

var str="#{zydt8spgzoa.mi8uhat7o47}+#{z3penrrf0cn.mi8uhat7o47}+#{lhubsvcmpwu.mi8uhat7o47}+#{ynpiwu7fw9m.mi8uhat7o47}"; 

i need content inside curly bracket array. (in above case array of length 4).

how can achieve this?

    var found = [],               rxp = /{([^}]+)}/g,     str = "#{zydt8spgzoa.mi8uhat7o47}+#{z3penrrf0cn.mi8uhat7o47}+#{lhubsvcmpwu.mi8uhat7o47}+#{ynpiwu7fw9m.mi8uhat7o47}",     mat;      while( mat = rxp.exec( str ) ) {           found.push(mat[1]);     }      alert(found);  

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -

r - Update two sets of radiobuttons reactively - shiny -