It works great but I want to also catch everything on the same line of XYZ. For example:/bin/cat $1 | perl -00 -pe 's/ABC(.*?)XYZ/\[DATA\]\n/s'
It will become:123 ABC 123 abc XYZ hi la
But with my regex it will be:123 [DATA] la
How can I catch also 'hi'?123 [DATA] hi la
In reply to Replacing between patterns by ovedpo15
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |