Hey Im trying to extract certain information from a string. The String looks like
Name: music mix.mp3 Size: 2356KB
I w
This is regex
Name:\s*(?[\w\s]+.\w{3})
this regex return the music mix.mp3 in group if the name of file is with white space
string strRegex = @"Name:\s*(?[\w\s]+.\w{3})";
Regex myRegex = new Regex(strRegex);
string strTargetString = @"Name: music mix.mp3 Size: 2356KB";
Match myMatch = myRegex.Match(strTargetString);
string fileName = myMatch.Groups["FileName"].Value;
Console.WriteLine(fileName);