Can't use Regex from System.Text.RegularExpressions with UE 5 in Build.CS

It worked in 4.27 an earlier, but in 5.0 preview i can’t use Regex from System.Text.RegularExpressions in Build.CS any more, it gets me next errors:

1>UnrealBuildTool : error : D:\Documents\Unreal Projects\MyProject\Source\MyProject\MyProject.Build.cs(20,3): error CS1069: The type name 'Match' could not be found in the namespace 'System.Text.RegularExpressions'. This type has been forwarded to assembly 'System.Text.RegularExpressions, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly.
1>UnrealBuildTool : error : D:\Documents\Unreal Projects\MyProject\Source\MyProject\MyProject.Build.cs(20,22): error CS0103: The name 'Regex' does not exist in the current context
1>UnrealBuildTool : error : D:\Documents\Unreal Projects\MyProject\Source\MyProject\MyProject.Build.cs(20,65): error CS0103: The name 'RegexOptions' does not exist in the current context

i am not sure how to deal with it

Just to keep tracking of issue - i have found same topics with UE 5.0 EA, so issue is stil there. Provided solution is not a solution using binary build :frowning:

Fix is comming in 5.1

Hello.

Here is possible workaround in my answer: