If you know exactly what pieces are going to change you could create a mycode including all static (constant) portions and using variables for dynamic (changing) portions. I did this on one of my sites to allow recaptcha mailhide.
For example, if all the variables specified and external scripts are only allowed come from one trusted source, you could create a mycode for it. Using the portion listed at the beginning...
<script type="text/javascript">var bfcParams = 'Symbol=VIX--X,TimeFrame=1-Day,NumberOfBars=134,WebChartID=274f746f-2a2d-4e62-a11a-fb9531e600c0';var bfcWidth = '600';var bfcHeight = '500';</script><script type="text/javascript" src="http://www.freestockcharts.com/script/bfcEmbeddedChart.js"></script>
would then turn into
Title
freestockcharts.com Chart
Regular Expression
/[chart params=(.*?) width=(.*?) height=(.*?)/](.*?)/[\chart/]
Replacement
<script type="text/javascript">var bfcParams = $1;var bfcWidth = $2;var bfcHeight = $3;</script><script type="text/javascript" src="http://www.freestockcharts.com/script/$4"></script>
Example
[chart params='Symbol=VIX--X,TimeFrame=1-Day,NumberOfBars=134,WebChartID=274f746f-2a2d-4e62-a11a-fb9531e600c0' width='600' height='500']bfcEmbeddedChart.js[/chart]
This would
ONLY work if the variables that need to be edited are always var bfcParams, var bfcWidth, var bfcHeight, and the file name of the external script. The variables
must contain the entire text from them, including the single quotations (if there is no form of quotations, it may not be read correctly by either mybb or the browser), and the file name at the end would have to be strictly the file name, not the entire URL.
This was just generated on the spot, I haven't tested it to verify that it would work. If you're going to attempt to use it, test first - don't assume it will work I'm not 100% sure it will.
The reason the file name at the end is a file name and not the entire URL is for security. By including the domain and subdirectory in the replacement code instead of having members specify it, the code is made to
only read scripts from that location (with that particular code).
If this code works (please test if you want to use it or me to modify it), I can very simply change the [chart][/chart] pieces to be something else (ie if there may be charts from more than one place to specify which source)