javascript - grab CSS value with Regex -


i hoping can me regex, need grab test2 , between { }

    .test1 {font-family: arial, helvetica, sans-serif; color: #42bf32; font-size: 14px; } .test2 {font-family: arial, helvetica, sans-serif; color: #42bf32; font-size: 14px; } .test3 {font-family: arial, helvetica, sans-serif; color: #42bf32; font-size: 14px; } 

i using asp , javascript

i have feeling regex test2.replace(/\.test(.*?)\{(.*?)\}/ig, '.test3');

any appreciated

thanks steward works fine .replace(/.test *{[^}]*/ig, '');

test2[[:space:]]*{[^}]*} 

but should use real css parser instead.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -