I am trying to parse a log file that generates in text. I want to retrieve a name and phone number.
Sometimes the info is not there and should be blank.

All examples I've seen tell me how to get the start of a string or end of a string but not what's inside.

Above there is a sample code I've been working with

```
  {
       public Form1()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {

        using(TextReader reader = new StreamReader("c:/ctb.txt"))
        {
            string line;                       
            while ((line = reader.ReadLine()) != null)
            {
                // Get the contents of 'per_full_name' [str] = "Smith, John"
                // which would be Smith, John
                // Get the contents of 'per_phone' [str] = "1 555 555-8888"
                // which would be 1 555 555-8888
                // Note this exists atleast twice in the file, I only need
                // Once into a string to be able to make textBox.
                // Text values change.
            }
        }
    }
    }

```

Example text file data:

it is a text file, the format is unknown to me, i beleive its a java output for its own logfile. 

```
[str] = "BI Shared Expense" 'org_level4_name' [str] = "Business      International Ins" 'org_level4_oid' [str] = "Business" 'per_first_name' [str] = "" 'per_full_name' [str] = "Smith, John" 'per_last_name' [str] = "" 'per_middle_name' str] = "" 'per_phone' [str] = "1 555 555-8888" 'qpriority' [str] = "norm" 

```

VERY long lines of text when not wordwrapped. 

The output I'd like is the full name to a string. To be able to use in other functions.

IE:

```
          string fullname = "Smith, John";

```

---

Trying this code now.

```
    private void button1_Click(object sender, EventArgs e)
        {
        using (StreamReader sr = new StreamReader("C:/ctb.txt"))
        {

            String line = sr.ReadToEnd();
            foreach (Match m in Regex.Matches(line, "/\\[(str)\\]\\ = \"\\w+\\, +\\w+\"/g"))
            {
                textBox1.Text = m.Value;
                richTextBox1.Text = textBox1.Text;
            }
        }
    }

```

Using this page to get the string but its wanting escapes in the actual program. 
<http://www.regexr.com/3bqll>

This locates only 'per\_full\_name' [str] = "Smith, John"