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

  • Home
  • SEARCH
  • 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 8607513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:22:27+00:00 2026-06-12T03:22:27+00:00

URL must be of the form: http://host.domain/scriptname.extension , no query string. ie, this is

  • 0

URL must be of the form: http://host.domain/scriptname.extension, no query string.
ie, this is a valid URL: http://abc.axx.loc:8000/abcd.aspx.
I tried to do it like below, but it doesn’t work well, anybody can help? thx.

var RegExp = /((h|H)(t|T)(t|T)(p|P)|(h|H)(t|T)(t|T)(p|P)(s|S)):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?\/\w+\.\w+$/;
  • 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-06-12T03:22:29+00:00Added an answer on June 12, 2026 at 3:22 am
    var RegExp = /^https?\/\/[\w\-\.]+(:\d+)?\/[\w\-]+\.[\w\-]+$/i;
    

    Notice after the // the block [\w\-\.]+ is for the host and domain combination. It should match host.domain as well as host.subdomain1.subdomain2.domain etc.

    The ^ and $ in the start and end is important so it matches the start and end of the string.

    Also notice the use of \w\- because \w alone is not enough as it does not capture dashes.

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

Sidebar

Related Questions

Is this a valid http url http://www.example.com?x&y or we must always have = sign
URL url = new URL(http://twitter.com/statuses/update.xml); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); String cridentials =
I have a json url like such... [{Image: http://xyz.com/abc.png , Title:Sample},{Image: http://xyz.com/def.png , Title:Sample2}
I have a url (http://www2.anac.gov.br/aeronaves/cons_rab.asp) where I need to post form data programatically. That
I have URLs of the form http://domain/image/⟨uuid⟩/42x42/some_name.png . The Web server (nginx) is configured
I got a problem with the div. It must look like this: http://cl.ly/2r0S043m301p410T2e3z but
i have a task - i must grab some data from the URL. the
Documentation: https://developers.facebook.com/docs/achievements/ Each achievement must possess a unique URL with the appropriate Open Graph
url : http://localhost/back-office/index.php/staff/shopping when i change the category on every onchange event i want
URL url = new URL(http://localhost:8080/Work/images/abt.jpg); InputStream in = new BufferedInputStream(url.openStream()); ByteArrayOutputStream out = new

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.