Activity Stream
48,167 MEMBERS
62694 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1.     
    #11
    Member
    Website's:
    EastsideHosting.com MediaONAIR.com ImgWiz.com cPadmin.net EastsidePCWorks.com HostedTalk.com
    Created: test.php

    PHP Code: 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>

    <body>
    <?php

    echo '<table width="50%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>Welcome to:</td>
      </tr>
      <tr>
        <td><strong>Hell</strong></td>
      </tr>
    </table>'
    ;

    ?>
    </body>
    </html>
    Created: curl.php

    PHP Code: 
    <?php
    error_reporting
    (-1);  

    $curlTarget "http://127.0.0.1/test.php";

    $ch curl_init();
    curl_setopt($chCURLOPT_URL,$curlTarget);
    curl_setopt($chCURLOPT_RETURNTRANSFER,1);

    $result curl_exec ($ch);
    curl_close($ch);

    preg_match ("/(<strong)(.*?)(>)(.*?)(<\/strong>)/i"$result$match);
    echo 
    $match[4];

    ?>
    Test: http://djdog2006.com/curl/test.php
    Curl: http://djdog2006.com/curl/curl.php
    EastsideHosting - (Web Hosting, Proxy Hosting, Reseller Program)
    MediaONAIR - (SHOUTcast Servers, ICEcast Servers, Reseller Program)
    Server Administrator - (Dedicated Servers, VPS Management, One Time Services)
    ImgWiz - (Free Image Hosting)

  2.   Sponsored Links

  3.     
    #12
    (╯?□?)╯︵ ┻━┻
    Website's:
    Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.com
    Seriously this is like watching regex being mutilated into some evil devil child lol.

    It *SHOULD* be (for the html above, to match just the contents of strong):
    Code: 
    #<strong>([^<]+)</strong>#i
    I don't know why anyone is matching two wildcards, strong doesn't have attributes (unless you're some insane guy who gives strong tags style attributes).

    As for your original post it would've been:
    Code: 
    #<td>Welcome to:</td>\s*<td>([^<]+)</td>#i
    Why you decided to make the whitespace it's own variable, Lock Down, I do not know. It isn't even whitespace.

    This:
    Code: 
    [\s\S]*
    is the same as this:
    Code: 
    .*
    Any amount of non-whitespace or whitespace characters == any amount of any characters.
    Projects:
    WCDDL - The Professional DDL Script
    Top Secret Project: In Development - ZOMG
    ImgTrack - Never Have Dead Images Again!

  4.     
    #13
    Respected Member
    Regex is some evil devil STEP child !!

  5.     
    #14
    Member
    Thank you fore your replies guys.
    The replies + my fiddling with my sources @work computer made me see that something in my system is messing with my xampp php install so I will be reinstalling from scratch on a virtual box properly.

    Yet, I have a question JMZ, what does the ([^>]+) and ([^<]+) means? I have seen it over and over on other sites but I can't find a proper description for that.

  6.     
    #15
    Member
    Website's:
    EastsideHosting.com MediaONAIR.com ImgWiz.com cPadmin.net EastsidePCWorks.com HostedTalk.com
    That's what I did in my example;

    If I was coding this myself, I would use;

    <strong id="identify" and display that in there so I know what it's actually getting.
    EastsideHosting - (Web Hosting, Proxy Hosting, Reseller Program)
    MediaONAIR - (SHOUTcast Servers, ICEcast Servers, Reseller Program)
    Server Administrator - (Dedicated Servers, VPS Management, One Time Services)
    ImgWiz - (Free Image Hosting)

  7.     
    #16
    (╯?□?)╯︵ ┻━┻
    Website's:
    Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.com
    Quote Originally Posted by PCManiac View Post
    Yet, I have a question JMZ, what does the ([^>]+) and ([^<]+) means? I have seen it over and over on other sites but I can't find a proper description for that.
    Code: 
    [^<]+
    Means one or more characters which aren't '<'.
    Quick way of matching things inside tags, but it will break with nested tags.
    Projects:
    WCDDL - The Professional DDL Script
    Top Secret Project: In Development - ZOMG
    ImgTrack - Never Have Dead Images Again!

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Looking for Exam Result Script
    By DevilLnC in forum Web Application/Script Support
    Replies: 5
    Last Post: 7th Feb 2014, 02:04 PM
  2. Need help with google search result
    By .nItIsH. in forum Webmaster Discussion
    Replies: 4
    Last Post: 4th Mar 2012, 07:54 AM
  3. preg_match help need!
    By saninokia in forum Web Development Area
    Replies: 8
    Last Post: 27th Nov 2011, 08:39 PM
  4. Why Google Result Going Down!!
    By indianmoviefans.info in forum Webmaster Discussion
    Replies: 13
    Last Post: 23rd Sep 2011, 08:00 AM
  5. Help with preg_match - php !
    By softleaks in forum Webmaster Discussion
    Replies: 5
    Last Post: 21st May 2011, 04:22 PM

Tags for this Thread

BE SOCIAL