Hi all,

I'm trying to write a regular expression that will match everything between to tags, including new lines, but not in a 'greedy' way.

i.e. I'd like to match everything between [lsit] and [/lsit] and capture everything between those tags.

e.g. If this is my haystack:
Code:
This is a list ...
[lsit]
a bunch of text that
spans several
lines
[/lsit]
... I'd like to be able to capture

Code:
a bunch of text that
spans several
lines
This what I've got so far:

[^\[lsit\](.+?)\[/lsit\]$]m

But I can't figure out how to match new lines. I first remove all \r characters from my haystack then I look for \n characters but they don't seem to match.

Can anyone offer any suggestions?

BTW I added some typos to my spelling of 'list' so that the forum would not try to replace them.