I have the following piece of coding which is used to grab a username inside of a textarea to make later use of the variable.
var username = $('#c_post-text').val().split(/(\[call\]|\[CALL\])/gi)[2].split(/(\[\/call\]|\[\/CALL\])/gi)[0];
Is there a way to iterate this piece of code so it can be used on multiple instances of the same BBCode, thus grabbing multiple usernames instead of the very first username that is found between the 'call' BBCode tags?
The following will turn all instances of the BBCode into an array, but I only need the username and the array returns the BBCode as well.
var username = $('#c_post-text').val().match(/(\[call\]|\[CALL\])(.+?)(\[\/call\]|\[\/CALL\])/gi);
I am using the ZetaBoards forum software platform and here is the source code: http://b2.ifrm.com/63/1/0/p474641/Mention_Notifications.js