| « Social Networks | A Scattered Update » |
I've put off for a long time learning regular expressions because they looked so complicated. Then this summer I ran up against them in my job. And it turns out that they actually aren't quite as alien as it seemed at first glance. Not just that, but now that I've learned how to use them, I find myself using them more and more. Instead of using a built in function to do string parsing like parse_url(), I find that doing it myself gives better and more controlled results. Instead of bending to suit the requirements of the built-in function, I just add a ? to my regex and poof - who cares if there's a protocol on that URL or not? If you've been putting off learning regex because it looks intimidating - go do it - it's worth it.
/.*/
PS. For PHP see preg_match() and other functions in that family.