Find a pattern in given string of URLs in Lua -
In my Lea code, I get the URL as several strings.
Example:
['http://www.abc.com/home/', 'http://www.abc.com/', https: //www.xyz.com/v/123443/css/ ', http://www.xyz.com/css/'] I want to receive URLs that Are the same:
https: //Www.xyz.com/v/123443/css/ where v is the pre-defined string pattern and 123443 < / Code> is a random version generated in the URL. Please help bring all the URLs that are liked in that pattern:
"/ v / 12332323 /"
str = "https://www.xyz.com/v/123443/css/" print (str: match ("Https?: // www%. [^ /] + (/ V /% d + /)% w +")) Output: / v / 123443 / This pattern matches the strings starting with http or https , and then : // , the website name starts with www , a / , pre-defined string v and "random" number followed by / and other stuff.
Comments
Post a Comment