title: SED manipulation on if condition / regex
body: <pre><code>images:
    image1:
      name: image1
      tag: VERSION
    image2:
      name: image2
      tag: latest
    image3:
      name: image3
      tag: VERSION
    image4:
      name: image4
      tag: latest
  </code></pre>
  
  <p>Hi Guys</p>
  
  <p>I have a small issue, as a part of SED command, I want to find image4 and replace the next line tag with a numerical version but only if the tag is not VERSION. I am using this command </p>
  
  <pre><code>sed '/name: image4/{!b;n;s/tag:.*/tag:NEW STRING/}' values.yaml
  </code></pre>
  
  <p>The command I am currently using is looking for image4 and replaces the next line tag: "latest" with "NEW STRING", but if I search for image3 I don't want to replace tag: VERSION with anything, just keep searching until tag: is all but not VERSION.</p>
  
  <p>Thank you</p>
  
  <p>/Vin</p>