c# - Regexp not working due to newlines? -
this have far, trying convert:
[quote="tom":1m8ud0zc]blah blah[/quote:1m8ud0zc] into
<table width="99%"><tr><td class="bbquote"><strong><em>originally posted tom</strong></em><br /><br />blah blah</td></tr></table> but text between quote tags can have newlines, seems make not work, can tell me how make (.*?) include matching every special char well?
message = regex.replace(message, @"\[quote=""(.*?)"":.*?](.*?)\[/quote:.*?]", "<table width=\"99%\"><tr><td class=\"bbquote\"><strong><em>originally posted $1</strong></em><br /><br />$2</td></tr></table>" );
use regexoptions.singleline. changes meaning of dot (.) matches every character instead of every character except \n.
message = regex.replace(message, @"\[quote=""(.*?)"":.*?](.*?)\[/quote:.*?]", "<table width=\"99%\"><tr><td class=\"bbquote\"><strong><em>originally posted $1</strong></em><br /><br />$2</td></tr></table>", regexoptions.singleline );
Comments
Post a Comment