I'm writing a PowerShell Script which extracts URL's from ASPX files and test if their HTTP Statuscode is equal to 200.
I found the following Regex to get the URL:
$regex = "(http[s]?|[s]?ftp[s]?)(:\/\/)([^\s,]+)"
select-string -Path $path -Pattern $regex -AllMatches | % { $_.Matches } | % { $_.Value }
But the return looks like this:
https://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css"/>
https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
as you can see, it doesn't really trim the end of the HTML Tags.
How can I edit my regex to get the URL without the HTML Tags in the end?
[^\s,]with[^\s,<>"]