I need to use JavaScript split but I'm useless at regex so what i wanna do is take a text which is CSS like structure eg:
var str = "selector {
width: 100px;
height: 20px;
}
.anything{
margin: 5%;
}";
str.split(/regex goes here/);
Expected output
[
0 = selector{width: 100px; height: 20px;},
1 = .anything{margin: 5%;}
]
Hopefully it's not too confusing but please ask if in doubt.
Thanks.