title: Regex pspad to replace item in line based on inclusion of other pattern
body: <p>I need to match an item in a line that, upon finding this, will replace another item in the line.  Ex:</p>
  
  <p>Find all lines containing: <code>code="ap"</code>
  Replace: <code>quant="*****"</code> with <code>quant="0"</code></p>
  
  <p>Note that the quant field I will need to replace could have multiple variables between the quotes.</p>
  
  <p>I tried from another thread:
  Need: replace "BBB" with "CCC" but only in lines that contain the word "AAA"</p>
  
  <p>Search: <code>((?=.*?AAA)[^\r\n]*)(BBB)</code></p>
  
  <p>Replace: <code>$1CCC</code></p>
  
  <p>However, I'm not sure if it will work with the quotes included in my find or how to enter the variable data in the initial quant replace.</p>