diff --git a/aegisub/dialog_search_replace.cpp b/aegisub/dialog_search_replace.cpp index 7410778fb..cdbaf7737 100644 --- a/aegisub/dialog_search_replace.cpp +++ b/aegisub/dialog_search_replace.cpp @@ -477,12 +477,24 @@ void SearchReplaceEngine::ReplaceAll() { count += reps; } } - // Normal replace else { - if (Text->Contains(LookFor)) { - count += Text->Replace(LookFor,ReplaceWith); - replaced = true; + if (!Search.matchCase) { + wxString Left, Right; + int pos; + while(Text->Lower().Contains(LookFor.Lower())) { + pos = Text->Lower().Find(LookFor.Lower()); + Left = pos ? Text->Left(pos) : _T(""); + Right = Text->Mid(pos+LookFor.Len()); + *Text = Left + ReplaceWith + Right; + count++; + } + } + else { + if(Text->Contains(LookFor)) { + count += Text->Replace(LookFor, ReplaceWith); + replaced = true; + } } }