Regex my=new Regex(@"(\[img\])(.[^\[]*)(\[\/img\])",RegexOptions.IgnoreCase);
str=my.Replace(str,@"<a href=ShowPhoto.aspx?path="+CBBS.BBS.Component.HexCode.ToHex($2,""utf-8"",false)+" target=_blank><img SRC=""$2"" border=0 onload=""resizeImage(this,775,2000)"" onmouseover=""javascript:if(this.resized) this.style.cursor='hand';"" onclick=""javascript:if(this.resized) window.open('$2');""></a>");
my=new Regex(@"\[dir=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/dir]",RegexOptions.IgnoreCase);我要在$2 加载一个CBBS.BBS.Component.HexCode.ToHex()处理方法,该如何写才正确呢