C# Regex doesn't work on client-side

It seems client-side c# regexs are broken. That’s a simple Regex:

Regex validationRegex = new Regex("^[_A-Za-z][_A-Za-z0-9]*$");
validationRegex.Match("test");

Throws the following error:

System.MethodAccessException: Error verifying System.Text.RegularExpressions.RegexRunner:Scan (System.Text.RegularExpressions.Regex,string,int,int,int,int,bool,System.TimeSpan): Method System.Text.RegularExpressions.Regex:ValidateMatchTimeout (System.TimeSpan) is not accessible at 0x0004
  at System.Text.RegularExpressions.Regex.Run (System.Boolean quick, System.Int32 prevlen, System.String input, System.Int32 beginning, System.Int32 length, System.Int32 startat) [0x00095] in <79485bcd6555446e91390e5b0350b7ca>:0
  at System.Text.RegularExpressions.Regex.Match (System.String input, System.Int32 startat) [0x00019] in <79485bcd6555446e91390e5b0350b7ca>:0
  at System.Text.RegularExpressions.Regex.Match (System.String input) [0x00021] in <79485bcd6555446e91390e5b0350b7ca>:0
  at Nova.Client.Scripts.Core.Initialize () [0x00026] in <422e43415a2245eabc13b057c6f65b90>:0

Known issue, unlikely to be fixed any time soon due to the insanely hacky Mono profile build pipeline.

1 Like