Here's my problem. I am creating a parser for a movie-type script (not a computer script, but a screenplay), and I need to select all of the lines underneath a certain scene heading. Here's an example script from Shakespeare's Hamlet.
#Scene 1#
Bernardo: Who's there?
Francisco: Nay, answer me: stand, and unfold yourself.
#Scene 2#
Horatio: Tis now struck twelve; get thee to bed, Francisco.
Marcellus: Peace, break thee off; look, where it comes again!
I need a way to select everything between "#Scene 1#" and '#Scene 2#'. Bernardo and Francisco should match, but Horatio and Marcellus should not.
I've tried using lookahead and lookbehind, but apparently they don't work across multiple lines.
/(?<=#Scene 1#)(.*)(?=#Scene 2#)/gim
If it's important, I'm using Python 2.7.