dir1\dir2\dir3\file.aspx.cs(343,49): error CS0839: Argument missing [C:\dir\dir\dir\dir\namespace.namespace.namespace.namespace\project.csproj]
I've been trying for hours to create a regular expression to extract just 2 areas of this string. The bold areas are the parts I wish to capture.
I need to split this string into two seperate strings:
- I'd like everything before the first "("
- everything between the "[" and "]" but not including the "project.csproj"
For #1 the closest i've gotten is (^.*\()
which will basically capture everything up to the first "(" (including the bracket though which I don't want)
For #2 the closest i've gotten is (\[.*\])
which will basically capture everything inside the brackets (including the brackets which i don't want).
Any of the words in the above string could change apart from ".csproj" "C:\" and ".cs"
Context: This is how MSBuild spits errors out when compiling. By capturing these two parts I can concatenate them to provide an exact link to the erroring file and open the file in Visual Studio automatically:
System.Diagnostics.Process.Start("devenv.exe","/edit path");