Workers Redirect URL using regex

Hey, i need to redirect a regex https://sub.example.com/blog/* to https://sub.example.com/newblog/$1. This setting will easily work with a pagerule. But how do i do it with cloudflare workers?

async function handleRequest(request) {
return Response.redirect(someURLToRedirectTo, code)
}
addEventListener(‘fetch’, async event => {
event.respondWith(handleRequest(event.request))
})
const someURLToRedirectTo = ‘https://sub.example.com/newblog/$1’ //this is wrong…
const code = 302

I don’t know coding. Help me with this.