Is there an equivalent of the PhP function preg_split for JavaScript?
Any string in javascript can be split using the string.split
function, e.g.
"foo:bar".split(/:/)
where split
takes as an argument either a regular expression or a literal string.