由于换行,Regexp无法正常工作?

这是我到目前为止,试图转换:
[quote="Tom":1m8ud0zc]blah blah[/quote:1m8ud0zc]
<table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by Tom</strong></em><br /><br />blah blah</td></tr></table>
但是引号标签之间的文本可以有换行符,这似乎使这不起作用,可以告诉我如何使(。*?)包括匹配每个特殊字符?
Message = Regex.Replace(Message,
                        @"[quote=""(.*?)"":.*?](.*?)[/quote:.*?]",
                        "<table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by $1</strong></em><br /><br />$2</td></tr></table>"
            );
    
已邀请:
使用
RegexOptions.Singleline
。它改变了点(。)的含义,因此它匹配每个字符而不是除了 n之外的每个字符。
Message = Regex.Replace(Message,
                        @"[quote=""(.*?)"":.*?](.*?)[/quote:.*?]",
                        "<table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by $1</strong></em><br /><br />$2</td></tr></table>",
RegexOptions.Singleline
            );
    
添加
n
表示换行符。 new6ѭ匹配除换行之外的所有内容     

要回复问题请先登录注册