I want to upgrade my rxjs code to the new syntax. to do so I use vscode and "find and replace" by regex.
the old syntax:
.pipe(
catchError((err) => {
...
})
)
.subscribe((res) => {
...
});
the new syntax is:
.subscribe({ next: (res) => { ... }, error: (err) => { ... });
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 catchError and subscribe. So how to make it work in the correct way?
\.pipe(\s\ScatchError(.*).subscribe(.*)
Also how can I replace everywhere I match this pattern to new pattern? regex101.com