Hello,

I have a text file. I want to extract all of the lines that are between
two unique strings within the file.  I've only been able to extract the
text that's between two strings, on a single line.

The file format is below, as well as the regex task.  The problem is
that the regex only reads one line, I suspect due to my lack of
understanding of the regex wildcarding regarding newline characters.
Can anyone clear me up on this?

<unwanted lines>
fred red blue
<wanted lines>
Mary yellow brown
<unwanted lines>


<property name="infilename" value="D:\CI-TF-dev\tmp\dummy.txt"/>
<loadfile file="${infilename}" property="fileContent" verbose="false"/>
<regex pattern="^fred(?'outpp'.*)blue" input="${fileContent}"/>
<echo message="output: ${outpp}"/>

[echo] output: red

THX

Curt


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to