Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 10:40

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



preg_match_all reading sitesource multiple lines and matches

Discussion on preg_match_all reading sitesource multiple lines and matches within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1

 
.yorliK's Avatar
 
elite*gold: 0
Join Date: Nov 2011
Posts: 1,448
Received Thanks: 1,257
preg_match_all reading sitesource multiple lines and matches


Solved
look at the bottom to see.

i read my own website (yea its really mine) with file_get_contents to display a specific text later.
I display data of interviews on my site and i want to read the interview headline and the time to use it on another site (later it links to the other site).

The relevant code block is a table.
I use this format for every interview. Thats why i want to read it with preg_match_all.
Code:
                                    <td>
                                        Interview 1
                                        <small style="color:gray">
                                            Persons 2
                                            Cameras 2
                                        </small>
                                    </td>
                                    <td>
                                        1018 min
                                    </td>
As you can see, "Interview 1" is the head and the time is "1018".
Interview 1, Persons 2, Cameras 2 and the time are different every time.

I tried it by my own but somehow the pattern go crazy and match only a few or nothing.

Code:
preg_match_all('/<td>\s*(.+?)\s*<small style="color:gray">\s*<\/small>\s*<\/td><td>\s*(.+?)\s*<\/td>/is', $mysite, $match)
As you can see, i used \s* for the line breaks and spaces and (.+?) to match.


What's wrong with my search pattern? Or any tips how i can do it smarter?


Solved

I used to solve it.

.yorliK is offline  
Reply


Similar Threads Similar Threads
Anybody could explain me or put the lines of code with IT for multiple ones hack?
04/26/2016 - Aura Kingdom - 0 Replies
Hello, I saw on the forum a lot of code for hack of Aura Kingdom.to and I would like to know or to put them simply, I still begin regarding hack and thus I would like to know if somebody is willing to explain to me ^^ ? Ps: I am French, forgive I beforehand for the faults
[BUG] Username on multiple lines
06/30/2014 - DarkOrbit - 11 Replies
Hey guys, so I decided to do what is Serraniel doing well : posting bugs :p This bug allow you to write your username on multiple lines, btw this works only on registration, if you try to edit your username it will show you an error message because you are using non-legit characters (<br/>) Well, so first you need to go on DarkOrbit | Für Fans von Browsergames mit Weltraum-Szenario, right click on the username textbox and click "Inspect element" ...
How to display multiple lines with 4 columns?
10/09/2013 - .NET Languages - 3 Replies
Hay I have a little problem ^^... I want to display multiple lines (how much is unknown) which each have 4 columns. But I don't know much about Windows Forms and the GUI Programming with C#, so I don't know how to implement that :s. The 4 columns should be selectable as one item (line). Each line should be made of 1 checkbox, 1 description and 2 dates. So I googled now for some time and tried out a lot but didn't find a good solution .. I hope someone of you have a good Idea :)
[C#]Reading Memory / Pointer with multiple Offsets.
01/12/2013 - .NET Languages - 23 Replies
I am used to coding in AutoIt. I am trying to move my project into C# but I have only about 2-3 weeks of experience. In AutoIt, I have this code here that reads the process memory and returns a value. $map = _MemoryRead(0x00B5CCB8, $handle) // Pointer address 0x00B5CCB8 $map = _MemoryRead($map + 0x02, $handle) // Offset 0x02 $map = _MemoryRead($map + 0xBD, $handle) // Second Offset 0xBD I am trying desperately to convert this to C# language and I need some help. Here is what I have...



All times are GMT +1. The time now is 10:41.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.