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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:29:45+00:00 2026-05-28T19:29:45+00:00

I have to retrieve this url from a dirty html page: ……… http://www.imdb.com/title/tt0092699/ ……

  • 0

I have to retrieve this url from a dirty html page:

……… http://www.imdb.com/title/tt0092699/ ……

Obviously url can also be

http://www.imdb.co.uk/title/tt0092699/
http://www.imdb.es/title/tt0092699/
http://www.imdb.com/title/tt0092699
https://www.imdb.com/title/tt0092699/
https://www.imdb.com/title/tt0092699

(.domain, http/https or without final slash)

  • 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-28T19:29:47+00:00Added an answer on May 28, 2026 at 7:29 pm

    Use this regex:

    preg_match("/https?:\/\/www.imdb\..*?\/title\/tt\d+\/?/", $html, $matches);
    

    The url you want will be in $matches[0].

    Here’s the regex meaning, broken down piece by piece:

    • / => start regex
    • https? => literal http followed by optional s
    • :\/\/www.imdb\. => literal ://www.imdb.
    • .*?\/ => matches the shortest string possible before a slash, then a slash; will match the domain end, whatever it is (com, co.uk, es, etc…) and the first slash following it
    • title\/ => literal title/
    • tt\d+ => literal tt followed by at least one digit (and it’s a greedy match, so it will match the most number of consecutive digits it can); will match ids in the format you provided
    • \/? => optional final /
    • / => end regex
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have this url: www.example.com/test.php?page=4 How do i retrieve the value of
If I have url like this: www.example.com/product/yellow-bed is it possible to retrieve product name
I want to retrieve id from ResponseUri. I have following URL http://site5.way2sms.com/Main.action;jsessionid=77C20044847CD2C97BA89217A4D040A8.w803?id=77C20044847CD2C97BA89217A4D040A8.w803 I want
I have tried this example http://www.bennadel.com/blog/1056-ColdFusion-CFPOP-My-First-Look.htm , but it retrieve emails from POP server.
I have a HTML table as follows. I want retrieve row values from this
I have this JSON http://www.progmic.com/ielts/retrive.php that I need to parse. When I do it
I have this html line: <time itemprop=datePublished datetime=1923-12>December 1923</time> (USA) How can i retrieve
I'd like to have a setup where developers can resolve/retrieve dependencies from a URL
I have a php script http://example.com/myapp/myscript.php running on an Apache server. I call this
I have arraylist myorderdata . I want to retrieve this arraylist to one String

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.