Posted on: 8/19/2014 7:16:55 PM | Views : 412

Hi,
The following program is able to extract headers information from a string.
string input = "M=013;X=rast;645.jpgNULœDüŠˆ.....M=217;X=rast;113.jpgNULÿñÿÿ&åbÿås....M=217;X=rast;1108.jpgNUL]_ÿ×ÉcË/..."; MatchCollection mc = Regex.Matches(input, @"M=.+?;X=.+?;.+?\.jpg", RegexOptions.Singleline); foreach (Match m in mc) { Console.WriteLine(m.Value); } Displays
M=013;X=rast;645.jpg M=217;X=rast;113.jpg M=217;X=rast;1108.jpg How can I get the content part i.e. ?
NULœDüŠˆ..... NULÿñÿÿ&åbÿås.... NUL]_ÿ×ÉcË/... I changed the MatchCollection to use Groups
MatchCollection mc = Regex.Matches(input, @"(M=.+?;X=.+?;.+?\.jpg)(.+?)", RegexOptions.Singleline); but this only displays the 1st character of the content
< ...

Go to the complete details ...