I am looking for a dynamic regex code which can extract all URL’s which starts with HTTP OR HTTPS.
Below is the sample paragraph for reference.
While browsing the internet, a user might start their day by visiting a secure site like https://example.com
to read news, then jump to an older blog hosted at http://blog.example.org
for archived content, or even type www.sample.net
directly into the browser out of habit. Developers sometimes access resources from ftp://ftp.example.com/files when downloading datasets, while businesses encourage communication through links such as mailto:info@example.com or quick contact options like tel:+1234567890. On a local machine, someone may open a document using file:///C:/Users/Public/readme.txt, experiment with embedded content using data:text/plain,HelloWorld, test applications via http://127.0.0.1:8080
, or manage settings through a local dashboard at http://localhost/admin
To extract only URLs that start with http or https, you can use the following regex: https?:\/\/[^\s"'>]+. This pattern matches both http:// and https:// links and correctly captures domains, IP addresses