I am trying to use a regex match where I pull all the characters on a specific line. Here’s the example. I have many files containing something like this. How can I use a regular expression to grab the text on the 3rd line (line 3) of the file. Some lines are empty. Some lines have text but line 3 always has values and those I need. Your assistance is greatly appreciated.
(Ignore the dashes. They are just for clarity here.)
strinput="This is the first line.
This is the third line.
This is the fourth line.
This is the sixth line."
output= System.Text.RegularExpressions.Regex.Match(strinput,"(?<=^(.*\n){2})(.+)").Value
Note: strinput and output variables are of DataType System.String