From ffde42c70c27badfb9d7b8b1918fe018db031875 Mon Sep 17 00:00:00 2001 From: crazytuzi Date: Tue, 26 May 2026 00:35:18 +0800 Subject: [PATCH] Remove RegularExpressions --- CoreCLR.Build.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/CoreCLR.Build.cs b/CoreCLR.Build.cs index 13e596e..80fe2ec 100644 --- a/CoreCLR.Build.cs +++ b/CoreCLR.Build.cs @@ -1,6 +1,6 @@ +using System; using System.Collections.Generic; using System.IO; -using System.Text.RegularExpressions; using EpicGames.Core; using UnrealBuildTool; @@ -305,11 +305,20 @@ public class CoreCLR : ModuleRules if (HierarchySection.TryGetValue("PublishDirectory", out var Value)) { - var Match = Regex.Match(Value, @"Path=""([^""]+)"""); + const string Prefix = "Path=\""; - if (Match.Success) + var Index = Value.IndexOf(Prefix, StringComparison.Ordinal); + + if (Index >= 0) { - return Match.Groups[1].Value; + Index += Prefix.Length; + + var EndIndex = Value.IndexOf('"', Index); + + if (EndIndex > Index) + { + return Value.Substring(Index, EndIndex - Index); + } } } }