title: C# Extract part of the string that starts with specific letters
body: <p>I have a string which I extract from an HTML document like this:</p>
  
  <pre><code>    var elas = htmlDoc.DocumentNode.SelectSingleNode("//a[@class='a-size-small a-link-normal a-text-normal']");
      if (elas != null)
     {
     //
       _extractedString = elas.Attributes["href"].Value;
     }
  </code></pre>
  
  <p>The HREF attribute contains this part of the string:</p>
  
  <pre><code>gp/offer-listing/B002755TC0/
  </code></pre>
  
  <p>And I'm trying to extract the <code>B002755TC0</code> value, but the problem here is that the string will vary by its length and I cannot simply use Substring method that C# offers to extract that value...</p>
  
  <p>Instead I was thinking if there's a clever way to do this, to perhaps a match beginning of the string with what I search?</p>
  
  <p>For example I know for a fact that each href has this structure like I've shown, So I would simply match these keywords:</p>
  
  <pre><code>offer-listing/
  </code></pre>
  
  <p>So I would find this keyword and start extracting the part of the string <code>B002755TC0</code> until the next " / " sign ? </p>
  
  <p>Can someone help me out with this ?</p>