RegEx Buddy upped my regex foo

2007-08-25 @ 02:31#

ok, i was able to download my purchased copy of RegEx Buddy and it is *cool.* within an hour or so, i was able to improve the quality and power of my regex within the exyus framework. i actually *removed* lines of procedural code -and- increased the flexibility of that same code. very cool!

so... i completed my update of the XmlFileHandler to allow for (theoretically) infinite nesting of resource objects. like this:

  • users
    • comments
      • updates

for a while, i was stumped, but know i have a decent (if not admirable) regex pattern that works. below is a sample resource declaration that takes advantage of the new changes to the framework.

    // secondary uri object
    [UrlPattern(@"/users/(?<uid>[^/]*)/comments/?(?<cid>[^/]*)(?<tail>\.xcs)[\?]?(?<args>.*)")]
    public class userCommentFile : XmlFileHandler
    {
        public userCommentFile()
        {
            this.LocationUri = "/users/{uid}/comments/";
            this.UrlPattern = 
              @"/users/(?<uid>[^/]*)/comments/?(?<cid>[^/]*)(?<tail>\.xcs)[\?]?(?<args>.*)";
            this.DocumentsFolder = "~/documents/users/comments/";
            this.StorageFolder = "~/storage/users/{uid}/comments/";
            this.XHtmlNodes = new string[] { "//notes" };
            this.LocalMaxAge = 600;
            this.ImmediateCacheUri = new string[]
                {
                    "/users/{uid}/comments/",
                    "/users/{uid}/comments/{cid}"
                };
        }
    }

i still need to exercise this a bit to make sure it's all cool. i also need to update my SqlXmlHandler to also support nested resource definitions, but that should be a bit easier now that i have the physical file version working.

all good stuff!

code