in reply to Replacing between patterns
I want to also catch everything on the same line of XYZ.
You can say that explicitly: s/ABC(.*?)XYZ\N*\n/\[DATA\]\n/s will produce your desired output. (Note \N was added in 5.12, for older versions you can say e.g. [^\n].)
Minor edits shortly after posting.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Replacing between patterns
by ovedpo15 (Pilgrim) on Oct 28, 2019 at 13:12 UTC | |
by haukex (Archbishop) on Oct 28, 2019 at 13:15 UTC |