January 2009 Entries

  • Regex to parse a string into tokens, like the command-line

    The following regex is useful to parse a line into its parts, separated by spaces, unless there are quotes, in which case the quotes take precedence.    ("[^"]*")|([^\s]+)   as a C# string it should be like this @"(\"[^\"]*\")|([^\s]+)", but I haven't tested it within code yet. I've only tested this with the excellent regex tool 'Expresso', from http://www.ultrapico.com, for building and testing Regular Expressions.  It is written with .NET, so it presumably uses the .NET regex engine.

  • Adding a SandCastle report to a project

    Add new project to solution, pick Visual C# / DocProject / DocProject type, call it something like <solution>_doc Use the SandCastle engine Choose presentation style (Visual Studio 2005?) Pick the projects to be included in the SandCastle build There will be .net 3.5 references in the new project, if you see the yellow triangles, just delete the references In Visual Studio Build / Configuration Mgr disable build the docs in Debug mode Read the MAML spec...