Fixed regex generator returning non-global RegExp

This commit is contained in:
Kir_Antipov 2024-01-03 18:07:11 +00:00
parent 915ab6b52b
commit 926b1a264b

View file

@ -160,7 +160,7 @@ export function getMinecraftVersionRegExp(versions?: Iterable<string>): RegExp {
pattern = `${version.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d")}|${pattern}`; pattern = `${version.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d")}|${pattern}`;
} }
} }
return pattern === VERSION_PATTERN ? VERSION_REGEX : new RegExp(pattern, "gs"); return new RegExp(pattern, "gs");
} }
/** /**