* Paul LeoNerd Evans <[EMAIL PROTECTED]> [2007-04-21 15:00]: > Theirs don't have the regexp matches like mine, but I guess > that could always be done after the components have been pulled > out. (Also the implementation is a bit less efficient, but that > can be neatened up).
I think of URIs as serialised structured objects, not just as strings; they even have an escaping mechanism. Running regexes against them to pluck out data is kinda like groping at HTML with patterns, just less likely to break because URIs are a much simpler serialisation format than markup languages. Putting intricate regexes, eg. for zipcodes, in the URI template is like putting zipcode validation in CGI.pm. It doesn’t belong there. The place for it is several layers down, in the model, which is environment agnostic and validates data the same way whether it comes from a web request or the command line or anywhere else. That’s how I see it. Regards, -- Aristotle Pagaltzis // <http://plasmasturm.org/>