I have a string:
string s = "GameObject.Find(\"MyObj\").GetComponent(\"MyComponent\")";
I want to extract "GameObject.Find(\"MyObj\")" where MyObj can include any number or type of characters except newline.
This is my code:
Match match = Regex.Match(s, "GameObject.Find(\".+\")");
I know I'm doing something wrong, but I'm not sure where to go from here. How can we make this expression work as intended?