I have c# code in which I run a perl file using commandline and capture that output in a c# string. I want to extract a certain word from this string using regex. I tried several methods to capture that specific word but it didnt work.
For example: the below text was captured in a string in c#
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
Initializing.
jsdns jsdnjs wuee uwoqw duwhduwd 9-8 is = COM10
uuwe sodks asjnjx
In the above code I want to extract COM10. Similarly this value can also change to COM12 or COM8 or COM15. I will always have COM in the text but the succeeding number can change.
Can someone let me know how to go about with regex. I used RegexOptions.Multiline but am not sure how to go about it. Also if an explanation is included it would be helpful.
