Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6676807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:02:19+00:00 2026-05-26T04:02:19+00:00

I am trying to extract .com, .net and .org links from a single webpage

  • 0

I am trying to extract .com, .net and .org links from a single webpage that contains various numbers of these. I am just learning about Regex using C#, but I am not sure how to setup a pattern that looks for the just .com, .net and .org extensions. Then print those urls with those endings. Any suggestions or websites that you can direct me to help me would be great.

here is what i got so far

WebClient client = new WebClient();
string extPattern = @"?.com|?.net|?.org;  //but i think i am not doing this right. 
string source = client.DounloadString(url) //read the Url and store the pages. 
//then not sure what to do. 

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:02:19+00:00Added an answer on May 26, 2026 at 4:02 am

    Try this regex:

    string extPattern = @"(http://)?[a-z0-9\-\.]+(\.com|\.net|\.org)";
    

    Anyway this is not the perfect way to achieve your goal because url are very different (could have http or https, with or without www).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to extract src attributes from: [attname src=http://example.org] somecontent [attname src=http://www.example.com] What I
I'm trying to use preg_match to extract info from href=domain.com/subdir/?key=value The info I want
I'm trying to extract the postal codes from yell.com using php and preg_replace. I
I am trying to extract all links that have /thumb/ in it within 's.
I am trying to extract images from flash on the following web-site: http://meijer.shoplocal.com/meijer/default.aspx?action=entryflash&storeref=120 I
I am trying to extract querystring values from a htmldocument. It contains a number
I'm trying to extract data from the following page: http://www.bmreports.com/servlet/com.logica.neta.bwp_PanBMDataServlet?param1=&param2=&param3=&param4=&param5=2009-04-22&param6=37# Which, conveniently and inefficiently
I'm trying to extract the text contained in a webpage. So that I'm using
I'm trying to develop a c#/asp.net application to extract data from a SQL server
Im trying to extract a YouTube link from just random text. e.g. This is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.