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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:42:04+00:00 2026-06-08T02:42:04+00:00

I am trying to load a remote website and get all numbers that are

  • 0

I am trying to load a remote website and get all numbers that are inside of parentheses. But what ends up happening is it only matches the last value.

Is my regex wrong? Am I using the correct flags?

I have added the example of what it should match on in the second $html variable.

    //$html = file_get_contents("http://example.com/test.html");

    $html = "(1234) (12) (1)  \r\n  (1346326)";
    preg_match_all("^[(\d)]+$^", $html, $matches, PREG_PATTERN_ORDER);
    print_r($matches);
    echo "<br>";
    foreach ($matches as $val) {
        echo "matched: " . $val[0] . "\n";

    }

Thanks.

  • 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-08T02:42:06+00:00Added an answer on June 8, 2026 at 2:42 am

    How about:

    preg_match_all("/\((\d+)\)/", $html, $matches, PREG_PATTERN_ORDER); 
    print_r($matches[1]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to load a small .txt file into mysql but get all my data
I'm trying to get some json data from a remote website. I run my
I'm trying to load an m3u8 file that's saved to the local filesystem, but
I trying to load and save setting with this code but when I closing
I’m trying to load local XML files with a remote XSL stylesheet. IE seems
I'm trying to use Microsoft.Sdc.Tasks.Web.Website.UpdateHttpErrorSetting to change the http error messages of a remote
i'm trying to load remote rss feed with jquery and a (aspx) proxy. I
http://www.queness.com/post/328/a-simple-ajax-driven-website-with-jqueryphp I'm trying to get the above script to work, but with some changes.
I've been trying to get wkhtmltopdf to convert pages on a website and it's
My Problem I am trying to load JSON encoded data from a remote site

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.