whats wrong with this regular expression c#?

Posted by Greezer on Stack Overflow See other posts from Stack Overflow or by Greezer
Published on 2012-09-25T09:36:09Z Indexed on 2012/09/25 9:37 UTC
Read the original article Hit count: 247

Filed under:
|

I runned into a problem with my regular expressions, I'm using regular expressions for obtaining data from the string below:

 "# DO NOT EDIT THIS MAIL BY HAND #\r\n\r\n[Feedback]:hallo\r\n\r\n# DO NOT EDIT THIS MAIL BY HAND #\r\n\r\n"

So far is got it working with:

String sFeedback = Regex.Match(Message, @"\[Feedback\]\:(?<string>.*?)\r\n\r\t\n# DO NOT EDIT THIS MAIL BY HAND #").Groups[1].Value;

This works except if the header is changed, therefore I want the regex to read from [feedback]: to the end of the string. (symbols, ascii, everything..)

I tried: \[Feedback]:(?<string>.*?)$

Above regular expression does work in some regular expression builders online but in my c# code its not working and returns a empty string.

can someone help me with this regular expression? thanks in advance

© Stack Overflow or respective owner

Related posts about c#

Related posts about regex