Je travaille sur un filtre de réponse. Im essayant d'attraper tous les expresion: $ sometext.sometext $ avec l'expression régulière suivante:.^\ W + \ w + \Filtre de réponse asp.net
$Dans ma mise en œuvre, il ressemble à:
public override void Write(byte[] buffer, int offset, int count)
{
// Convert the content in buffer to a string
string contentInBuffer = UTF8Encoding.UTF8.GetString(buffer);
string [email protected]"^\\w+?\.\w+?\$";
RegexOptions options = RegexOptions.Multiline;
MatchCollection matches = Regex.Matches(contentInBuffer , regex, options);
foreach (Match match in matches)
{
string value = match.Value;
}
outputStream.Write(UTF8Encoding.UTF8.GetBytes(contentInBuffer), offset, UTF8Encoding.UTF8.GetByteCount(contentInBuffer));
}
Le problème est lorsque j'écris $ Catch.Me $ sur une page ASPX Il ne sera pas attrapé par mon expression régulière dans la méthode d'écriture. Qu'est-ce que je manque?
Votre méthode de remplacement est erronée. Réponse. Le contenu du filtre est fragmenté. Regardez http://www.west-wind.com/weblog/posts/2009/Nov/13/Capturing-and-Transforming-ASPNET-Output-with-ResponseFilter –