So I’ve been silently proud (until now) about a few number/money parsers, URL parsers and such that I’ve written.
One reason why I am so proud of them, is that they are NOT perfect. However, they are short and sweet and cover, my guess is, about 99.5% all cases of data they are given and produce the proper results. If someone is trying to be malicious, they can be, but that won’t get them too far, since I encode everything I can remember to, into-db and outto-html. Basically 99% of my DB queries aren’t written by hand and are created via my ORM (SimpleModel), so that helps me from getting exhausted by writing queries, which typically leads to flaws.
There we go. I’m happy to have taken only few minutes to parse money and urls.