quote:
Originally posted by Pai
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 (moo in this case), and not an array with the matches (Smilie)
it does return captured text ( stuff within () ) if you dont use the G modifier which is something I forgot about in my example
eg javascript shell output
code:
//first test
"[b]moo[/b][b]aaa[/b]".match(/\[b\](.*?)\[\/b\]/);
-> [b]moo[/b],moo
//with G
"[b]moo[/b][b]aaa[/b]".match(/\[b\](.*?)\[\/b\]/g);
-> [b]moo[/b],[b]aaa[/b]