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

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -