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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:25:57+00:00 2026-05-28T14:25:57+00:00

Original format: <a href=http://www.example.com/t434234.html …> 1. I need to fetch all URLs of this

  • 0

Original format:

<a href="http://www.example.com/t434234.html" ...>

1. I need to fetch all URLs of this format:

http://www.example.com/t[ANY CHARACTER].html

ANY CHARACTER is where value changes from URL to another. The rest are fixed.

Here is my attempt:

preg_match("#http:\/\/www\.aqarcity\.com\/t[a-zA-Z0-9_]\.html#", $page, $urls);

I get empty results. I don’t know where i went wrong…

  • 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-28T14:25:58+00:00Added an answer on May 28, 2026 at 2:25 pm

    The problem appears to be that [a-zA-Z0-9_] will only match exactly one character. If you want to match zero or more characters, use [a-zA-Z0-9_]*. For one or more, use [a-zA-Z0-9_]+. For exactly six characters, use [a-zA-Z0-9_]{6}. For e.g. one to six characters, use [a-zA-Z0-9_]{1,6}.

    Also note that, since you’re using # as the delimiter, you don’t need to escape the / characters. As far as I know this will not make your code misbehave, but it’ll be easier to read if you remove the backslashes before the slashes.

    Finally, please realize that regular expressions are a rather dangerous way to work with HTML. In this case, you may pick up matching URLs from comments, Javascript code, and other things that aren’t links. It is literally impossible to correctly parse HTML with unaugmented regular expressions—they don’t have the expressive power necessary to do so. I don’t know what sorts of HTML parsers are available for PHP, but you may want to look into them.

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

Sidebar

Related Questions

How do I transform www.bestbuy.com/site/Electronics\Audio\abcat0200000.c=3fid=3dabcat0200000 into its original format? www.bestbuy.com/site/Electronics/Audio/abcat0200000.c?id=abcat0200000 Is there a urldecode
This actually works: def tileshift(original, size, iterations): im = Image.open(original) format = im.format x,
is there a way to convert byte[] to its original file format? Byte[] tempByte
Original problem: What is the right column format for a unix timestamp? The net
original string is a,d,k I want to remove all , and make it to
[Original] I have a ListBox which has its ItemsSource (this is done in the
fff.html is an email with email addresses in it some have href mailto links
Is there any way in HTML/CSS to format a legal document that needs to
i want to convert my original format to JSON format My original format is
I have 2 seperate domains at present, I have installed Magento on www.laptops.com, Magento

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.