There's probably a much cleaner solution, but this will fix your problem. Basically, keep replacing until the regex can't find a match. It's not a full-proof solution, but will work on correctly formatted BBCode
...
for (var i = 0; i < find.length; i++) {
while(find[i].test(text)) {
text = text.replace(find[i], replace[i]);
}
}
...