title: Replace the first occurrence of the string using regex in powershell
body: <p>I was working some replace string using regex in powershell. 
  But When I try to implement the first occurrence in the stringto replace a word. It does not work.</p>
  
  <p><code>(((Grant Execute.*)\n+go)(\n)?)</code> This is my working regex if I want to replace all the matches.  </p>
  
  <p><code>^(((Grant Execute.*)\n+go)(\n)?)</code> I used this when I want to replace the first occurrence of the string...  </p>
  
  <p>Below is the string that I want to replace. This data is came from a batch file.
  <code>
  Grant Execute on dbo.Table to server1 
  go
  Grant Execute on dbo.Table to server2 
  go
  Grant Execute on dbo.Table to server2</code></p>