title: Regular Expression to end of line
body: <p>I'd like to find commented lines within a string using regular expressions. I tried the following but it gives me everything after the first <code>//</code>.</p>
  
  <p>Why?</p>
  
  <pre><code>program Project1;
  
  uses
    RegularExpressions;
  
  var
    Text: string;
    Pattern: string;
    RegEx: TRegEx;
    Match: TMatch;
  begin
    Text := 'Hello' + #13#10
      + '// Test' + #13#10
      + 'Text' + #13#10;
  
    Pattern := '//[^$]*$';
  
    RegEx := TRegEx.Create(Pattern, [roCompiled, roMultiLine]);
    Match := RegEx.Match(Text);
    if (Match.Success) then
    begin
      Match.Index; // 8 -&gt; Expected
      Match.Length; // 15 -&gt; I would like to have 9
    end;
  end.
  </code></pre>