title: How to extract id from url ? Google sheet
body: <p>I have the follow urls. </p>
  
  <pre><code>https://docs.google.com/spreadsheets/d/1mrsetjgfZI2BIypz7SGHMOfHGv6kTKTzY0xOM5c6TXY/edit#gid=1842172258
  https://docs.google.com/a/example.com/spreadsheets/d/1mrsetjgfZI2BIypz7SGHMOfHGv6PTKTzY0xOM5c6TXY/edit#gid=1842172258
  https://docs.google.com/spreadsheets/d/1mrsetjgfZI2BIypz7SGHMOfHGv6kTKTzY0xOM5c6TXY
  </code></pre>
  
  <p>Foreach url, I need to extract the sheet id: <code>1mrsetjgfZI2BIypz7SGHMOfHGv6PTKTzY0xOM5c6TXY</code> into a java String. </p>
  
  <p>I am thinking of using <strong>split</strong> but it can't work with all test cases:</p>
  
  <pre><code>String string = "https://docs.google.com/spreadsheets/d/1mrsetjgfZI2BIypz7SGHMOfHGv6kTKTzY0xOM5c6TXY/edit#gid=1842172258";
  String[] parts = string.split("/");
  String res = parts[parts.length-2];
  Log.d("hello res",res );
  </code></pre>
  
  <p>How can I that be possible?</p>