How to match a pattern and output its line followed by multiple lines up to an empty line #384
-
QuestionContext option However, what I want is to match a line and output it followed by all lines up to the first empty line. See also #369 by @vt-alt and also Q&A #371 to match a block of lines (similar) AnswerUse lazy quantifiers in the regex to match a $ ug -o '.*PATTERN(.|\n)*?\n\n' file.txt where |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Note: see answer in the question post. |
Beta Was this translation helpful? Give feedback.
Note: see answer in the question post.