How does permalink normalization with regex work?

I went to this setting Admin > Permalinks > Settings
Which says it will apply the regex before matching the permalink.

I have an old xenforo forum URL which is
http://localhost/threads/xyz-abc-is-ghp.223846/

And the new discourse URL is
http://localhost/t/xyz-abc-is-ghp/274528

When I enter the xenforo URL in the browser without the slug like the following then it is redirecting fine but not with it.
http://localhost/threads/223846/

So I tried to use the following regex to strip the slug out but it seems to be doing nothing. Am I missing a step or is this not how its to be done?
/^(/threads/)[^.]+.(\d+)/?$/+/\1\2

You don’t need a \2. And you need a \ before the period that you’ure searching for. You’ve got only one thing in parentheses. Maybe something like

/^(/threads/)[^.]+\.(\d+)/?$/threads/\1
1 Like

/threads\/[^.]+\.([0-9]+)\/?/threads/\1

this worked