I want to get every string between [ch] and [/ch]
var test = "[ch]Bm[/ch] Time flies by when[ch]A[/ch] the night is young[ch]C[/ch]"
var testRE = test.match("\[ch\](.*)\[/ch\]"); alert(testRE[1]);
But, the result I get is:
h]Bm[/ch] Time flies by when[ch]A[/ch] the night is young[ch]C[/c
How to store every string inside an array? My desired result is become
chords = ["Bm","A","C"]