Unity freeze with RegExp

I can freeze Unity 100% with the following code.

using UnityEngine;
using System.Collections;
using System.Text.RegularExpressions;

public class Test : MonoBehaviour
{
	void Start()
	{
		Regex reSym = new Regex(@"^\s*(\-?\b*[_a-zA-Z]+[_a-zA-Z0-9]*)");
		Match m = reSym.Match("0.1+0.2");
	}
}

Any ideas how to work around this… bug?

The editor and your game script share the same mono. I do not know if your RegEx is correct or not, but I wonder if you’ve got the Regex code into a loop somehow. Infinite loops or recursive code with no exit conditions can cause Unity to appear unresponsive as the game script consumes all the cpu. Probably not a bug in Unity.