I have a random file with a bunch of lines. Snippet:
lorium0{([y])} Contrary to popular belief, Lorem Ipsum is not simply random text cold
lorium0{([y])} Contrary to popular belief, Lorem Ipsum is not simply random text hot
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout
There are many variations of passages of Lorem Ipsum available
lorium0{([y])} Contrary to popular belief, Lorem Ipsum is not simply random text tea
There are many variations of passages of Lorem Ipsum available
lorium0{([y])} Contrary to popular belief, Lorem Ipsum is not simply random text bee
etc
I want to match every line starting with lorium0{([y])} and then replace simply with very using the vi or vim editor (Preferably with vi). Would like to accomplish this with a 1 line command.
- Find Regex match to filter out unwanted lines
- Find word simply and replace with very
ie.:
lorium0{([y])} Contrary to popular belief, Lorem Ipsum is not simply random text bee
Becomes:
lorium0{([y])} Contrary to popular belief, Lorem Ipsum is not very random text bee
Trying:
:1,$ s\(lorium0[^ ].*\)\1\(simply\)\2\1: very\2g
But having difficulty formatting the command and understanding capture groups in substitution.
Thanks.