diff --git a/replace.bat b/replace.bat
index 428f38a..8f95f44 100644
--- a/replace.bat
+++ b/replace.bat
@@ -32,7 +32,7 @@ if !errorlevel! equ 0 (
echo WARNING: Backup failed
)
-powershell -Command "$content = [System.IO.File]::ReadAllText('%FILE%'); $content = $content -replace 'http[s]?://[^\s\<\"]+', '%NEWURL%'; [System.IO.File]::WriteAllText('%FILE%', $content, [System.Text.Encoding]::UTF8); Write-Host 'SUCCESS: Replacement completed'"
+powershell -Command "$content = [System.IO.File]::ReadAllText('%FILE%'); $pattern = 'http[s]?://[^/<\"]+(/[^<\"]*)?'; $content = $content -replace $pattern, '%NEWURL%$1'; [System.IO.File]::WriteAllText('%FILE%', $content, [System.Text.Encoding]::UTF8); Write-Host 'SUCCESS: Replacement completed'"
if errorlevel 1 (
echo ERROR: PowerShell command failed