quote:
code:
/* text is an array
text[0] will contain the full matched string eg [b]moo[/b]
text[1] will contain the first match eg moo
if there was another match it would be in text[2] and so on...
*/
That would be correct if we were using PHP (preg), but doesn't apply to JScript ... text only contains a string with the matched expression ([b]moo[/b] in this case), and not an array with the matches
Test case:
code:
var Message = "this is just a [b]test[/b] string that doesnt make [u] any sense [/u] ..";
var text = Message.match(/\[b\](.*?)\[\/b\](.*?)\[u\](.*?)\[\/u\]/g);
Result:
text[0] or text: [b]test[/b] string that doesnt make [u] any sense [/u]
text[1,2,3,...,N]: null