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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:38:05+00:00 2026-05-13T17:38:05+00:00

I use matching URLs in a part of my code. Now I use regular

  • 0

I use matching URLs in a part of my code. Now I use regular expressions for this. This is fine, but does not always produces “nice”, simply readable patterns. Is there any language defined for matching URLs? It should be like this: http://*.example.com/* so simply wild-cards and things useful for URL would be there.

The best would if these expression can be simply transformed to regexp. Do you know specification for such a language, or even an implementation, preferably for ruby.. otherwise I implement it myself… the key is the readability of the patterns. Thanks for help!

  • 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-13T17:38:05+00:00Added an answer on May 13, 2026 at 5:38 pm

    You’d have to carefully work your syntax out before you begin. At first glance, what you intend would be easily achieved by translating your syntax into ordinary regexes:

    s = 'http://*.example.com/*' #=> "http://*.example.com/*"
    r = Regexp.compile("^#{Regexp.escape(s).gsub('\*','.*')}$") #=> http:examplecom
    'http://test.example.com/path/to/doc.html' =~ r #=> 0
    'http://test.example2.com/path/to/doc.html' =~ r #=> nil
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Duplicate of: There is a function to use pattern matching (using regular expressions) in
I'm trying to use the Daring Fireball Regular Expression for matching URLs in Java,
sometimes i use debug code to alert something in javascript (for example, matching something
use this website a lot but first time posting. My program creates a number
I'm trying to use a URL matching regular expression that I got from http://daringfireball.net/2010/07/improved_regex_for_matching_urls
There is a simple C++ method to use pattern matching on strings? The code
I'd like to use mod_rewrite to make pretty URLs, but have a single version
Initially, this code was written to create pretty urls. When using the code below,
I'm trying to make my app a good Windows citizen, so I use matching
I notice the standard regex syntax for matching across multiple lines is to use

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.