title: Extract Public Id From Cloudinary URL
body: <p>I am using Cloudinary to host my media on the cloud for my NodeJS project.
  To delete an image from the Clodinary Cloud, I need to pass a Public Id for that image, to the Cloudinary API.
  I realised, Public ID is embedded into the url, <strong>how to I extract it out from the URL</strong>?</p>
  <p><em><strong>Because, I don't want to store my data in this format :</strong></em></p>
  <pre><code>image : {
      url : `http://res.cloudinary.com/cloud_name/image/upload/v1647610701/rsorl4rtziefw46fllvh.png`,
      publicId : `rsorl4rtziefw46fllvh`
  }
  </code></pre>
  <p><em><strong>Rather, I find it better to store it like this :</strong></em></p>
  <pre><code>image : `http://res.cloudinary.com/cloud_name/image/upload/v1647610701/rsorl4rtziefw46fllvh.png`
  </code></pre>