G
Guest
I'm analyzing large strings and finding matches using the Regex class. I
want to find the context those matches are found in and to display excerpts
of that context, just as a search engine might. In terms of code, what's the
easiest way to make that happen? The code below works fine for identifying
the matches, but it doesn't try to extract the surrounding context or
display it:
currPageText = [method which grabs text from my source]
numberOfMatches = Regex.Matches(currPageText,
pattern,RegexOptions.IgnoreCase).Count;
Response.Write("found " + numberOfMatches + "<br>");
Thank you,
-KF
want to find the context those matches are found in and to display excerpts
of that context, just as a search engine might. In terms of code, what's the
easiest way to make that happen? The code below works fine for identifying
the matches, but it doesn't try to extract the surrounding context or
display it:
currPageText = [method which grabs text from my source]
numberOfMatches = Regex.Matches(currPageText,
pattern,RegexOptions.IgnoreCase).Count;
Response.Write("found " + numberOfMatches + "<br>");
Thank you,
-KF