help for splitting a string in javascript

Posted by Hero on Stack Overflow See other posts from Stack Overflow or by Hero
Published on 2010-04-30T05:16:01Z Indexed on 2010/04/30 5:27 UTC
Read the original article Hit count: 194

Filed under:

Hi everyone...

I'd asked a question about the splitting the a string like below:

Input string: "a=>aa| b=>b||b | c=>cc"

and the output:

a=>aa

b=>b||b

c=>cc

Kobi's answer was:

var matches = "a=>aa|b=>b||b|c=>cc".match(/(?:[^|]|\|\|)+/g)

his answer was correct.

But I need to use "split" method and save store the outputs in a array.

so I can't use the Match Method.

So please help me...

© Stack Overflow or respective owner

Related posts about JavaScript