diff --git a/aegisub/dialog_search_replace.cpp b/aegisub/dialog_search_replace.cpp
index 7410778fb9e66929e70546b0bbf0144fbe22109c..cdbaf773780d1c22f242b1dc847ff03c5ccd1636 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;
+				}
 			}
 		}