title: Edit Windows .reg Files with sed / grep: search for a FilePath output RegPath Key Value
body: <p>I am currently trying to edit a full dump .reg File on Linux Mint. The Goal is to find a given path in the values an then to print out the corresponding regpath the key and the full value itself.</p>
  
  <p>I know that I can achieve this using regex patterns in grep or sed unfortunately I am pretty new to the named programs.</p>
  
  <p>Heres one Example: I am searching for C:\\ProgramData</p>
  
  <pre><code>[HKEY_LOCAL_MACHINE\...]
  "noPath0"="1.1.9103.0"
  "path0Key"="C:\\ProgramData\\..."
  "noPath1"="2.1.9103.0"
  "path1Key"="...C:\\ProgramData\\..."
  
  [HKEY_LOCAL_MACHINE\...]
  "noPath0"=dword:00000000
  </code></pre>
  
  <p>The output should be the following:</p>
  
  <pre><code>[HKEY_LOCAL_MACHINE\...]
  "path0Key"="C:\\ProgramData\\..."
  "path1Key"="...C:\\ProgramData\\..."
  </code></pre>
  
  <p>I've figured out the following two regexPattern: </p>
  
  <pre><code>Regpath: ^\[.[^\]]*\n
  Key+Value: .*C\:\\\\ProgramData.*
  </code></pre>
  
  <p>The problem is how do I combine both patterns and use them in grep or sed or what ever is more suitable for this task ?</p>