Hi all,

I need to match string from {=BeginCatRecords=} to {=EndCatRecords=}....

Here is the HTML code from a file (categories.html), I a reading in a variable st :


 
  {=BeginCatRecords=}{=EndCatRecords=}
 
 

{=CatName=}
{=CatDesc=}
 
 

In this file, from {=BeginCatRecords=} to {=EndCatRecords=} is written in one line.. and it is working fine...

But if I split it in multiline like :

{=BeginCatRecords=}


 

{=CatName=}
{=CatDesc=}
 
{=EndCatRecords=}

It stops working...

Below is the code I am using to match the string :

string NavMatch = null;
pattern = @"{=BeginCatRecords=}.*?{=EndCatRecords=}";
Match MatchTop = Regex.Match(st, pattern, RegexOptions.Multiline);
NavMatch = MatchTop.ToString();


I suppose, I need to change either the pattern or I am missing any option while matching the string...

If you have any other logic to do the needful, please let me know..

Please help..

Suman Singh