I am using The following regex pattern to find text between [code] and [/code] tags:
[code]
[/code]
(?<=[code]).*?(?=[/code])
You need to use back referencing, i.e. replace \[code\](.*?)\[/code\] with something like $1 which will give you what's been enclosed by the [code][/code] tags enclosed in -- for this example -- tags.
\[code\](.*?)\[/code\]
$1
[code][/code]