المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : DirectoryInfo.GetDirectories() search patterns



C# Programming
05-08-2009, 08:31 AM
Hello,

I want to search a set of directories that are organized by "LastName FirstName". However, the number of spaces between each name might vary (most only have 1 space, but some have 2 or 3 b/c of a typo). The only search pattern I know of to accommodate this is "LastName*FirstName", but I'd rather use some regex like "LastName[ ]+FirstName", that only allows spaces between the names. Is this possible, or would I just have to get all directories and manually evaluate the regex on each one?

Thanks,

Dybs