Monday, February 12th, 2007
He created parseUri and thinks it has advantages:
- Ability to split the directory path and file name.
- If a path component was present in the source URL, it will always return a trailing slash as the last character in the directoryPath component (this is easy to remove if a user does not want this functionality).
- Offers convenient, pre-concatenated commonly used component pairs (authority = domain + port; path = directoryPath + fileName).
- Much lighter weight (literally only a few lines of code).
- Cleaner syntax (e.g., parseUri(someUri).port).
- Unlike the alternative code, it does not include an extemely weak and flawed attempt at validation.
- It’s much more flexible, since all URL components are optional.
- Uses cleaner regular expression syntax.
- More closly follows the generic URI syntax spec set in RFC 3986
So, Is there any leaner, meaner URI parser out there?
Posted by Dion Almaer at 5:28 am