a[b].innerHTML=a[b].innerHTML.replace(RegExp('['+bbc[c][0]+']','ig'),bbc[c][1])
This is basically what I'm working with. It's wrapped in two loops so that should explain why it looks like what it does. Basically I want to replace something that matches '['+variable from an array+']'. I'm making a BBCode script for a free forum and no don't point me at any BBCode scripts. The problem is that regex is replacing everything that matches any character. So, it replaces [, q, c, o, d, e, ], all with the second part of the array. (QCODE is an example BBCode being used) I don't know if it does that in a normal /regex/ with [] but it's annoying as hell. I've tried escaping the [] ('\['+v+'\]'), I've tried eval(), I've tried everything you can imagine. I need to make this thing work like it's supposed to, because everything is set up as it should be. If you know how to fix this, please answer. I'd like you to test your solution before answering though because you have no idea how many methods I've tried to make this work.