By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,825 Members | 1,364 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,825 IT Pros & Developers. It's quick & easy.

Need help with Regex

P: n/a
I'm becoming nuts with regex and preg_match_all. I hope someone could help ...
Here is my problem :

Match</td>
<td align="center" valign="middle" class="textnoir">final</td>
<td align="center" valign="middle" class="textnoir">mi temps</td>
<td align="center" valign="middle" class="textnoir">en cours</td>
<td align="center" valign="middle" class="textnoir">P</td>
</tr>

I want to extract
<td align="center" valign="middle" class="textnoir">final</td>
<td align="center" valign="middle" class="textnoir">mi temps</td>
<td align="center" valign="middle" class="textnoir">en cours</td>
<td align="center" valign="middle" class="textnoir">P</td>

I tried :
preg_match_all ('/Match<\/td>(.*?)<\/tr>/', $page_html, $titre);

and many more things but nothing works. I suspect <, >, </ to be the problem.

The one who gives me solution will have my gratitude for eternity !

Many thanks,

Gaelle
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
In article <c1**************************@posting.google.com >,
ni************@yahoo.fr (G. Delavaquerie) wrote:
The one who gives me solution will have my gratitude for eternity !


Here you go:

preg_match_all('/Match<\/td>(.*?)<\/tr>/s', $page_html, $titre);

Note the /s modifier after the pattern. This allows . to match a
newline, in this case the newline after the first </td>.

JP

--
Sorry, <de*****@cauce.org> is een "spam trap".
E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.
Jul 17 '05 #2

P: n/a
You are The One !

So many thanks !
Jan Pieter Kunst <de*****@cauce.org> wrote in message news:<de***************************@news1.news.xs4 all.nl>...
In article <c1**************************@posting.google.com >,
ni************@yahoo.fr (G. Delavaquerie) wrote:
The one who gives me solution will have my gratitude for eternity !


Here you go:

preg_match_all('/Match<\/td>(.*?)<\/tr>/s', $page_html, $titre);

Note the /s modifier after the pattern. This allows . to match a
newline, in this case the newline after the first </td>.

JP

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.