Do you want something like this:
http:\/\/[A-Za-z0-9\.]*(\/[A-Za-z0-9]*)?\/[A-Za-z0-9]+[0-9]{1}
Test it here: https://regex101.com/r/cnxvR0/1
It will match anything starting with http://
followed by any alphabet character, any digit or .
(dot), optionally followed by another forward slash (/
) and ends with 1 or more alphabet characters or digits and it has to end with a single digit.
I'm sure this will not help for all of your cases, but you have to be more specific, how many digits are there at the end, is it always only one ? Does the URL have to end with a digit or it's optional ? How many nested directories can there be (I made my regex for only one) ?
Let me know if the regex above will do what you need or post in the comment section answers to the questions above and I'll edit my answer accordingly.
OK SO AFTER YOU EDITED YOUR ORIGINAL QUESTION:
(?<=href=")(?:[\w-]+\/?)*
Try it here: https://regex101.com/r/q0tf5l/2
Let me know if this is what you wanted, you can iterate through all of the matches and print them out or whatever you need to do with them.