I have a long string and I need to find instances of '#!#'+some text+'#!#'
right now I have:
string.replace(/(#!#*#!#)/g, function (m) {....});
I need the whole thing passed into a function like that so that I can replace them correctly.
However, I want m to only be equal to what lies between the two #!#..I want this part..#!#
but what I return needs to replace the entire #!#'+some text+'#!#
If it matters the text between the two #!#'s will be either an integer or a sentence, but it won't contain the pattern #!# of course.