Help with Get Group from Matched Text

I feel that I’m SOOO close!

I’m trying to make a short cut that would transform the following string

into

{{< stoot instance=“front-end.social” id=“113013572565735964” >}}

I’ve got the regular expression working and tested in https://regex101.com

/https?:\/\/([-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b)*\/\@([-a-zA-Z0-9._%+-]+)\/([\d]+)/gm

Is there a better way of getting the groups other than matching twice?

Here is a direct link to the shortcut.
https://www.icloud.com/shortcuts/89dc46f4c4904c4480c92df85ed9d56d

You can get multiple groups from the same “Match Text” action:

https://www.icloud.com/shortcuts/8c32265561eb4f5db4516714a586dd90

But you can also do what you want much faster with a regex replacement:

https://www.icloud.com/shortcuts/ba389bb4a0ed4959a8af8a9e06a6a28a

Thank you! I’m using the first result but will switch to the second because I feel that I’ll be able to remember and enhance it

You’ll have to relax the rules for the domain in your regex because it won’t match long TLDs like infosec.exchange

Example: https://infosec.exchange/@briankrebs/113053040276551404