How to redirect Webp files?

If I’m reading it right, your regex has only two items in (), which means that only $1 and $2 have any meaning.

I copied your sample text and went to https://regex101.com/ (note: this is not an endorsement) to try to assemble a regex that’ll cover all your images. Here’s what I ended up with:

Pattern: ^(.*\/[0-9]{1,4}\/[0-9]{1,2}\/)([^\.]+)\.(jpg|jpeg|gif|png)\.webp
Replacement: $1$2.$3

This is using the PCRE standard, which is apparently used in PHP < 7.3. You may need to tweak the regex if you’re using PHP 7.3 or 7.4 (or higher), or if you want to use it in a .htaccess file.