Q:

how to break the string with regex

I need to break this type of string using javascript:
3a.jpg;44.jpg;45.jpg;43.jpg;3a.jpg;44.jp;45.jpg;43.jpg;

into this:
3a.jpg
44.jpg
...

tried something like:
var regex = /(\d+)/g;
console.log(text.match(regex));
arr.push(text.match(regex));

With this code I get something like: 3a 44 45....

A:

var array = yourString.split(";");

On a side note, I firmly believe regex should generally be used a last resort option for string manipulation.

