title: Replace : and any char after that using regex
body: <p>I have the following strings</p>
  <pre><code>var s1 = &quot;Group:0.Devices.Cabins:0.Position.GroupStop:0.GroupStop&quot;;
  var s2 = &quot;Group.Devices.State:15X.GenericState&quot;;
  var s3 = &quot;Group.Devices.State.HealthState&quot;;
  var s4 = &quot;Group:1.Devices:7A.Cabins:0.Doors:0.State:0&quot;;
  </code></pre>
  <p>I need to remove <code>:</code> and <code>any char</code> after it .Expected result:</p>
  <pre><code>Group.Devices.Cabins.Position.GroupStop.GroupStop
  Group.Devices.State.GenericState
  Group.Devices.State.HealthState
  Group.Devices.Cabins.Doors.State
  </code></pre>
  <p>I used something like this:</p>
  <pre><code>Console.WriteLine(Regex.Replace(Regex.Replace(s1, @&quot;\:.*?\.&quot;, &quot;.&quot;), @&quot;\:.*?$&quot;, &quot;&quot;));
  Console.WriteLine(Regex.Replace(Regex.Replace(s2, @&quot;\:.*?\.&quot;, &quot;.&quot;), @&quot;\:.*?$&quot;, &quot;&quot;));
  Console.WriteLine(Regex.Replace(Regex.Replace(s3, @&quot;\:.*?\.&quot;, &quot;.&quot;), @&quot;\:.*?$&quot;, &quot;&quot;));
  Console.WriteLine(Regex.Replace(Regex.Replace(s4, @&quot;\:.*?\.&quot;, &quot;.&quot;), @&quot;\:.*?$&quot;, &quot;&quot;));
  </code></pre>
  <p>It works, but are there any more efficient ways how to do that? I want to use it with compiled regex.</p>
  <pre><code>private static Regex _regex = new Regex(@&quot;....&quot;, RegexOptions.Compiled);
  </code></pre>
  <p>Then <code>_regex.Replace(s1, string.Empty);</code></p>
  <p>Could you please help me to merge 2 regex into one?
  Thank you in advance</p>