Got more questions? Find advice on: ASP | SQL | XML | Windows
Welcome to RegexAdvice Sign in | Join | Help

Catching a multiline text block

  •  04-05-2008, 8:11 PM

    Catching a multiline text block

    Hi all, I have a get a piece of text from a document and I don't find the way to it with a singular regEx.

    The text has the following structure:

    ------DataBlock------- 

    Foo1=Foo 

    Foo2=Foo

     --------------------------

    ------DataBlock------- 

    Foo3=Foo 

    Foo4=Foo

     --------------------------

    ------DataBlock------- 

    Foo5=Foo 

    Foo6=Foo

     --------------------------

     I have to get every block between "------DataBlock------- " and " --------------------------" and process they. I was trying with different combinations, in example

      (?<= (------DataBlock-------))(\w|\W)* (?=(--------------------------)), but I catchs from after the first "------DataBlock------- " to before the last "--------------------------", and

    I need a match for every block.

    Please, could someone help me? 

View Complete Thread