I think the below macro I just posted should meet your needs, as I understand them. Please review/test the macro, and post your feedback here. There are links to both solutions at RegEx101.com.
###MACRO: Extract Data with RegEx from End of URL
Please note there are at least TWO possible solutions. You may want to review the various forms your source URL will be in, and adjust the RegEx.
###Possible RegEx Solutions
USER CHOICE: Review these solutions and choose the one best for your use case.
Copy the RegEx expression and paste into the “Search Variable” Action.
FIRST SOLUTION – See https://regex101.com/r/tyAOOA/1
Allow for any digit to precede the Capture Groups
This is the most flexible solution.
SECOND SOLUTION – See https://regex101.com/r/X37oty/1
Requires specific numbers prior to the Capture Groups:
!3d AND !4d
This is the more reliable solution.