1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Any regular expressions for any number of lines between certain keywords?

Discussion in 'General Scripting Chat' started by mightybh, Apr 29, 2013.

  1. mightybh

    mightybh Jr. VIP Jr. VIP Premium Member

    Joined:
    Feb 27, 2008
    Messages:
    1,029
    Likes Received:
    1,714
    Occupation:
    CEO
    Location:
    UK
    I have a lot of text files. Each text file has a description which can contain any number of lines and any characters. I need to remove those. So this is what the text files look like:

    Description:

    bla bla bla
    bla bla bla
    bla bla bla

    Body:

    body body body
    body body body
    body body body

    Is there any way to remove everything including "Description:" and "Body:" so that I'm just left with:

    body body body
    body body body
    body body body

    I tried replacing "Description:([^<]*)Body:" but it just matches any character in the line. Not multiple lines of anything.

    Any ideas? Thank you!

    -edit-

    All sorted. Found this example <script[^>]*>([^<]*)<\/script> which deletes the script tags and anything in between. I then adapted it to my needs.
     
    Last edited: Apr 29, 2013