title: How to use regex to find and replace for new rxjs syntax?
body: <p>I want to upgrade my rxjs code to the new syntax. to do so I use vscode and &quot;find and replace&quot; by regex.</p>
  <p>the old syntax:</p>
  <pre><code>.pipe(
   catchError((err) =&gt; {
     ...
   })
   )
   .subscribe((res) =&gt; {
     ...
   });
  </code></pre>
  <p>the new syntax is:</p>
  <pre><code> .subscribe({ next: (res) =&gt; { ... }, error: (err) =&gt; { ... });
  </code></pre>
  <p>I try to do with this regex I built but I seems that the regex is wrong and not sure why because in that regex I find what between <code>catchError</code> and <code>subscribe</code>. So how to make it work in the correct way?</p>
  <pre><code>\.pipe(\s\ScatchError(.*).subscribe(.*)
  </code></pre>
  <p>Also how can I replace everywhere I match this pattern to new pattern?
  <a href="https://regex101.com/r/hANBxK/1" rel="nofollow noreferrer">regex101.com</a></p>