From: Daniel Sheppard Date: 2006-06-06T08:55:29+09:00 Subject: Re: New webserver > -----Original Message----- > From: list-bounce@example.com > [mailto:list-bounce@example.com] On Behalf Of Stuart Brand > Subject: New webserver > > Im designing a webserver as my first project on Ruby > > I need help with this line > > fileLine.sub(/\.\.\//, '') If you want to write a http server, read the http specification and go from there. Trying to sanitise a url with regexs WILL leave you with security holes. If you're writing anything for which there's a specification, read the specification carefully and implement (preferably test-first) from that. The specification writers are much smarter than you, and will have thought of many things that you will not think of until it's too late. Regexs are GREAT for all sorts of string manipulation tasks, but they're the wrong tool for parsing even a mildly complex language. Parse the input using a proper parser. That said, as long as you never, ever plan on exposing this thing to the public internet, have fun learning.