Hack Forums
[Python] Need Some RegEx For This Type of URL - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] Need Some RegEx For This Type of URL (/showthread.php?tid=6159443)



Need Some RegEx For This Type of URL - zogra - Jun 18, 2021

Ok so I need a RegEx that can get the url below and then I will be able to print the url to the console, if you can do it please make a RegEx that gets the url containing 720P thanks in advance

Here is the URL: https://websitehere/videos/201904/11/217790671/720P_4000K_217790671.mp4?validfrom=1624025401&validto=1624032601&rate=500k&burst=1000k&ipa=31.158.240.125&hash=NYdizwhVXPl2hM3uaw4uQKkJqzo%3D



RE: Need Some RegEx For This Type of URL - AeroBlue - Jun 18, 2021

So what exactly are you trying to capture? That whole url, or just the 720P part?


RE: Need Some RegEx For This Type of URL - zogra - Jun 18, 2021

(Jun 18, 2021 08:52 AM)Aero Blue Wrote:  So what exactly are you trying to capture? That whole url, or just the 720P part?

the whole part but since in the source there are 3 URLS I need to get the one with 720P


RE: Need Some RegEx For This Type of URL - AeroBlue - Jun 18, 2021

(Jun 18, 2021 08:56 AM)zogra Wrote:  the whole part but since in the source there are 3 URLS I need to get the one with 720P

This will vary slightly by language but hopefully this works:

Code
https:\/\/.+?\/.+?\/720P.+?%3D



RE: Need Some RegEx For This Type of URL - zogra - Jun 18, 2021

(Jun 18, 2021 09:02 AM)Aero Blue Wrote:  This will vary slightly by language but hopefully this works:

Code
https:\/\/.+?\/.+?\/720P.+?%3D

Thanks dude