echo -e 'zero\none\ntwo three' | perl -0777 -pe 's{\s*(one\ntwo)\s* +^( *)}{\n\n<begin block>\n\n$1\n\n<end block>\n\n$2}m' zero one two three
In reply to Re^2: matching and mysterious captures
by Allasso
in thread matching and mysterious captures
by Allasso
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |