I\'m trying to match a pattern from piped input and/or a file, and then remove from the matched lines to the end of the file, inclusive. I\'ve looked everywhere, but can\'t
Here's a regular expression that I think will do what you want it to: ^(?:(?!Files:).)+|\s*-----THIS STUFF IS USELESS-----.+ Make sure to set the dotall flag.