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 110391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:13:11+00:00 2026-05-11T02:13:11+00:00

In regards to this: http://stackoverflow.uservoice.com/pages/general/suggestions/103227-parser-does-not-match-all-valid-urls is this regex adequate or will it need to

  • 0

In regards to this: http://stackoverflow.uservoice.com/pages/general/suggestions/103227-parser-does-not-match-all-valid-urls is this regex adequate or will it need to be refined, if it needs to be refined how so?

\b(?P<link>(?:.*?://)[\w\-\_\.\@\:\/\?\#\=]*)\b 
  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T02:13:11+00:00Added an answer on May 11, 2026 at 2:13 am

    Even though the question is vague, I’ll attempt to respond with possible solutions.

    Possible Intention 1: To match any URL’s in a given file (for replacement):

    /^([^:]+):\/\/([-\w._]+)(\/[-\w._]\?(.+)?)?$/ig 

    The above should match nearly all URL formats, with the following captured groups:

    0 => entire match 1 => protocol (eg. http, ftp, git, ...) 2 => hostname (eg. www.stackoverflow.com) 3 => requested_file_path (eg. /images/prod/1/4/success.gif) 4 => query_string (eg. param=1&param2=2&param3=3) 

    Possible Intention 2: To get details about the current request url

    In order to get details about the url such as the protocol, hostname, requested file path, and query string, you’re better off using language/object methods to gather the results. In php you can get all of the above information using function calls:

    $protocol = $_SERVER['SERVER_PROTOCOL']; // HTTP/1.0 $host = $_SERVER['HTTP_HOST']; // www.stackoverflow.com $path_to_file = dirname($_SERVER['SCRIPT_NAME']); $file = basename($_SERVER['SCRIPT_NAME']); $query_string = $_SERVER['QUERY_STRING']; 

    Hope this helps in any way.

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

Sidebar

Related Questions

This question is in regards to this blog entry. https://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/ All the way at
trying to follow this tutorial http://www.codeguru.com/csharp/csharp/net30/article.php/c15489 I'm not able to select the sql server
http://jsfiddle.net/fzTak/7/ i came across one post telling this on stackoverflow but it is not
This question is in regards to Mike Bostock's very exciting d3.js library in general,
Im trying to find a regular expression that matches this kind of URL: http://sub.domain.com/selector/F/13/K/100546/sampletext/654654/K/sampletext_sampletext.html
I've a must to create wcf service with parameter. I'm following this http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/8f18aed8-8e34-48ea-b8be-6c29ac3b4f41 First
Hi fellow StackOverflow guys, First of all this is on Magento 1.7.0.2. I have
I'm using the login form of this website http://www.html-form-guide.com/php-form/php-login-form.html , And i would like
I am just starting out with canvas. I made this: http://www.kingoslo.com/instruments/ The arrow for
I found this plugin: http://vim.wikia.com/wiki/Find_files_in_subdirectories to be really useful to find a file(s) using

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.