<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 08.00.0681.000">
<TITLE>Parsing multiple lines from text file using regex</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Consolas">Hi,<BR>
I am having an issue with something that would seem</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Consolas">to</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Consolas">have an easy solution,</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Consolas">but</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"> <FONT SIZE=2 FACE="Consolas">which escapes me.  I have configuration files that I would like to parse.  The data I am having issue with is a multi-line attribute that has the following structure:<BR>
<BR>
banner <option> <banner text delimiter><BR>
Banner text<BR>
Banner text<BR>
Banner text<BR>
...<BR>
<banner text delimiter><BR>
<BR>
The regex 'banner\s+(\w+)\s+(.+)' captures the command nicely and banner.group(2) captures the delimiter nicely.<BR>
<BR>
My issue is that I need to capture the lines between the delimiters (both delimiters are the same).<BR>
<BR>
I have tried various permutations of<BR>
<BR>
Delimiter=banner.group(2)<BR>
re.findall(Delimiter'(.*?)'Delimiter, line, re.DOTALL|re.MULTILINE)<BR>
<BR>
with no luck<BR>
<BR>
Examples I have found online all assume that the starting and ending delimiters are different and are defined directly in re.findall().  I would like to use the original regex extracting the banner.group(2), since it is already done</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Consolas">, if possible</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"><FONT SIZE=2 FACE="Consolas">.  </FONT></SPAN></P>
<BR>

<P DIR=LTR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Consolas">Any help in pointing me in the right direction would be most appreciated.<BR>
<BR>
Thank you,<BR>
<BR>
Marc<BR>
</FONT></SPAN><SPAN LANG="en-us"></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN></P>

</BODY>
</HTML>