@rene That indeed looks like something beyond my knowledge of SQL.
I roughly see what's going on from the code - but I would not be able to write it myself.
Also the query would become more complex if we would like to be able to get URLs in general. For example, if we wanted @fullUrl do be http://math.uga.edu/~pete/integral.pdf or http://math.uga.edu/~pete/expositions2012.html depending on the post.
I guess looking at the body and checking for something like http://math.uga.edu.*"> or even <a href=".*">` might be able to return all URLs - or only specific URLs.
But still for me (considering the tools I am familiar with) it is much easier to search for the URLs locally - after downloading the relevant posts from the results of a SEDE query (or maybe even using the data dump in some cases).
Yeah, you want to stay away as long as possible from writing T-SQL. It is not only slow but the language itself didnt age well, it is clunky at best by today standards. And you can get a long way with just processing sets. Even if you want to "loop" over a body text a recursive CTE might be preferable. I just wanted to demo for you what "procedural" would look like.