I recommend you step back from what you’re doing and take 30 minutes or so to read up on regular expressions. This is a fairly trivial application of them.
In JavaScript, you can do it like this:
var match, value;
match = /\[quote#([^\]]+)\]/.exec(yourString);
value = match && match[1];
5
solved Regex for Javascript for [quote] [closed]