Skip to content

Commit

Permalink
スレタイ©マーク置換処理のバグ修正 #12
Browse files Browse the repository at this point in the history
  • Loading branch information
onihusube committed Jul 12, 2023
1 parent 8cf9825 commit edffc77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 2chAPIProxy/DatProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1516,12 +1516,12 @@ private void intervene_in_dat_response(ref Session oSession, bool is2ch)
if (CRReplace)
{
// スレタイの©マークを置換
var re = new Regex(@"^.+?<>.*?<>.+?<>.+?<>(.+?&#169;.+?)\t");
var re = new Regex(@"^(.+?<>.*?<>.+?<>.+?<>.+?)&#169;(.+?\t)");

if (re.IsMatch(resdat))
{
// 最初の一個だけを置換
resdat = re.Replace(@"&#169;", "&copy;", 1);
// 正確にスレタイに含まれているもののみ置換
resdat = re.Replace(resdat, (match) => { return $"{match.Groups[1].Value}&copy;{match.Groups[2].Value}"; }, 1);
}
}

Expand Down

0 comments on commit edffc77

Please sign in to comment.