We have urls in the following URL formats, I want to get only digit values between the strings I specified, I tried a pattern like this
(?<=\/sub.example.com\/)(.*)(?=\?[Uu]rl|$) but it does not give the result I want
[ 79084, 64931 ]
I need to exclude
Note that it will match all the digits after domain name e.g.
https://sub.example.com/79084/t/64931/1234/6789 will have 4 matches for all the numbers.
(?<=\/sub\.example\.com\/(?:[^\/]*\/)*): Lookbehind to assert presence of
sub.example.com/followed by 0 or more repeats of path components separated with
\d+: Match 1+ digits
(?=(?:\/[^\/]*)*(?:\?[Uu]rl|$)): Must be followed by 0 or more repeats of path components separated with
/and that must be followed by
?Urlor line end.