Re: Regular Exception - problem with preg match
- From: Justin Koivisto <justin@xxxxxxxxx>
- Date: Tue, 17 Jan 2006 08:47:30 -0600
kuka8 wrote:
> Hello Everybody !
>
> I need to parse a website, but I have a problem with preg_match
> function ,
>
> for example, i have a string ...
>
> $string = ' junk<table><b>BINGO</b></table>
> junk<table><b>bingo2</b></table>
> junk2<table><b>bingo3</b></table>';
>
> preg_match('|<table+*(.*)</table>+|sim', $string $r);
> echo $r[0];
> echo $r[1];
>
> is not working
>
> How to catch only bingo's ?
> I need only content of table tags as each element of array.
Try this:
preg_match_all('|<table[^>]*>(.*)</table>+|siU', $string, $r);
--
Justin Koivisto, ZCE - justin@xxxxxxxxx
http://koivi.com
.
- References:
- Regular Exception - problem with preg match
- From: kuka8
- Regular Exception - problem with preg match
- Prev by Date: Re: Emulation: If I wanna test cross domain session between 2 domains,
- Next by Date: Re: Emulation: If I wanna test cross domain session between 2 domains,
- Previous by thread: Regular Exception - problem with preg match
- Next by thread: Emulation: If I wanna test cross domain session between 2 domains,
- Index(es):
Relevant Pages
|