I am using strawberry perl for windows.
I have following rtf text for example for performing regex find and replace
1
2
3
4
dog
1
2
3
4
5
puppy
7
8
I am using following regex in notepad++ for testing which works. I don't know how to use the same in perl. I have tried all the way but could not make it happen. below is one of my one liner.
perl -i.bak -pe "BEGIN{undef $/;} s/(dog)(.*[\r\n]+){6}(.*)/$&$1=$3/smg" 4.txt8
Here I want to identify dog = puppy. How to identify string that are fixed lines apart and do the replacements?
In reply to Regex find and replace involving new line by PRA007
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |