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.
Print | posted on Monday, January 26, 2009 9:55 AM