3 ms·
ah, good to see the old regex for <a href="(image.?)" I wrote a little parser for this site a while back to display the daily photo as a desktop gadget, and ha
by magic_haze 14y ago
ah, good to see the old regex for <a href="(image.?)"
I wrote a little parser for this site a while back to display the daily photo as a desktop gadget, and had to resort to the same hack to get the image out. It's a shame there isn't a rss feed for this yet.. it is a bit hard to be believe that in this day and age, thousands of pieces of code around the world are relying on how one guy decided to write his html.
[Ninja Edit:] For what it is worth, here's the regex I actually ended up using:
^<a\s*?href\s*?=\s*?['"](image/.+?)\1\s*?>$
but obviously, this is equally fragile.
- randomdrake 14y agoI plan on using an actual DOM parser on my next pass as I fully stand by and believe that you should never parse markup with regex. http://stackoverflow.com/a/1732454 http://stackoverflow.com/a/1732454