I guess I don't understand what it is you want.
"test
[say=say test] testing more :
]"
"
[say=say test[testing more:
]"
Both get valid hits by what you described earlier (Hello World can be anything, but the [say=] will always be the same). Both have the
[say= and the ending
] and some text in between.
Using sed, this is what I get:
$ echo $TESTING
test [say=say test] testing more :]
Show all, except what's in between
[say= and the ending
]
$ echo $TESTING | sed 's/\(\[say=\).*\(\]$\)/\1\2/'
test [say=]
Show all, except
[say= and the ending
]
$ echo $TESTING | sed 's/\(\[say=\)\(.*\)\(\]$\)/\2/'
test say test] testing more :
And for the second example:
echo $TESTING
[say=say test[testing more:]
Show all, except what's in between
[say= and the ending
]
$ echo $TESTING | sed 's/\(\[say=\).*\(\]$\)/\1\2/'
[say=]
Show all, except
[say= and the ending
]
$ echo $TESTING | sed 's/\(\[say=\)\(.*\)\(\]$\)/\2/'
say test[testing more:
Both look correct to me, but we probably are talking about different things
I'm not familiar with javascript and have some experience with PHP, cannot tell you if there is a function in PHP that would do what you want.
Could/would you elaborate on what it is you are trying to do.