Can you please read the 'posting guidelines' note at the top of this forum and provide the details mentioned there; in particular the regex and programming language you are using.
The general answer to your question is along the lines of:
\[0008\](.*?)(\[0009\]|#)
and look at match group #1 for the data.
Another approach may be:
(?<=\[0008\])((?!#|\[0009\]).)*
which will return only the item you are after but this requires lookarounds to be supported by your regex engine. Also, this assumes that the data to be retrieved will terminate at the first "#' or "[0009]" so that "fred [0008]wombat #3 is the subject of the study[0009]" will return "wombat ".
Susan