title: Regex if statement problems
body: <p>First post so I am sorry if I do not provide enough information, however, I will try my best. Also, it is probably wise to note I have bare minimal knowledge of this, I know basically what this code does and that is it. </p>
  
  <p>In short I am a member or a simulation game community which mainly consists of cruising around running from/being the police. the game logs all chat messages as they are sent straight to a .txt file and this code searches said chatlog for one of the parameters listed in the code below and if it matches one it will play the corresponding "beep".</p>
  
  <p>The first two work however the third one i have some struggles with and was wondering if anyone here could help me understand. One of the features these "cops" have is a speed gun, which shows results in-game like so: </p>
  
  <p><code>user clocked @ 105kph/ 65mph• ignored</code> *</p>
  
  <p><code>user clocked @ 138kph/ 86mph•</code> **</p>
  
  <p>* this is below the speed limit</p>
  
  <p>** this is above the speed limit</p>
  
  <p>however in the chatlog they appear like this:</p>
  
  <pre><code>user ^Lclocked @ 138kph/ 86mph•
  
  user ^Lclocked @ 63kph/ 39mph•^L ignored
  </code></pre>
  
  <p>i have tried using varied wildcards(assuming they work) and writing the code in both fashions like so:</p>
  
  <pre><code>Regex expspeeding = new Regex(@"mph• ", RegexOptions.IgnoreCase);
  Regex expspeeding = new Regex(@"#mph•^L ignored ", RegexOptions.IgnoreCase);
  </code></pre>
  
  <p>but it simply does not work.</p>
  
  <p>Below is the main bulk of what I have, please if anyone can even suggest a direction to go in that would be greatly appreciated.</p>
  
  <p>Any questions you have I will try my best to answer.</p>
  
  <p>Thanks for your time.</p>
  
  <pre><code>{
  public partial class Form1 : Form
  {
      LogFileTracer tracer;
  
      // The search patterns
      Regex expdc = new Regex(@"Disconnected", RegexOptions.IgnoreCase);
      Regex expidle = new Regex(@"You will be kicked soon", RegexOptions.IgnoreCase);
      Regex expnospeeding = new Regex(@"?• ignored", RegexOptions.IgnoreCase);
  
  
      public Form1()
      {
          InitializeComponent();
  
  
          tracer = new LogFileTracer();
          tracer.onTextReceived += Tracer_onTextReceived;
      }
  
      // Event if line was read from logfile
      private void Tracer_onTextReceived(string text)
      {
          try
          {
              if (InvokeRequired)
              {
                  // Thanks Microsoft for that threading bullcrap
                  this.Invoke(new LogFileTracer.TextReceivedDelegate(Tracer_onTextReceived), text);
                  return;
              }
          }
          catch
          {
              // Nobody cares
          }
  
          if (text == null || text.Length == 0) return;
  
          // Check whether any of the patterns match
          if (expdc.IsMatch(text))
          {
              // play sound pattern
              txtEventLog.AppendText(text + "\r\n");
              Console.Beep(1000, 100);
              Console.Beep(750, 100);
              Console.Beep(500, 100);
  
          }
          else if (expidle.IsMatch(text))
          {
              // play sound pattern
              txtEventLog.AppendText(text + "\r\n");
              Console.Beep(2000, 50);
              Console.Beep(2050, 50);
              Console.Beep(2000, 50);
  
          }
          else if (expnospeeding.IsMatch(text))
          {
              // play sound pattern
              txtEventLog.AppendText(text + "\r\n");
              Console.Beep(1000, 50);
              Console.Beep(2050, 50);
              Console.Beep(2000, 50);
  
          }
      }
  
      private void timer1_Tick(object sender, EventArgs e)
      {
          LblStatus.Text = "Logger Status: " + (tracer.isAlive ? "running" : "dead");
  
      }
  
      private void Form1_Load(object sender, EventArgs e)
      {
          // Try to start the reader with the textbox
          if (!string.IsNullOrEmpty(TxtFilename.Text)) tracer.start(TxtFilename.Text);
      }
  
      private void CmdStart_Click(object sender, EventArgs e)
      {
          // Start or restart the tracer
          tracer.start(TxtFilename.Text);
      }
  
  }
  </code></pre>
  
  <p>}</p>