str = "https://www.xyz.com/v/123443/css/"
print(str:match("https?://www%.[^/]+(/v/%d+/)%w+"))
Output: /v/123443/
This pattern matches strings that starts with http
or https
, and then ://
, the website name starting with www.
, a /
, the pre-defined string v
and "random" numbers, followed by /
and other stuff.