|
Posted by Rik on 07/30/06 05:01
The.Relinator@gmail.com wrote:
> the file would be an html file such as the one below,and I hope to get
> the 23.324.4.034:344, 35.622.66.34:8080 from it
>
> <html>
> <head>
> <title> Test </title>
> </head>
> <body>
> random text 23.324.4.034:344
> random text random text
> 35.622.66.34:8080 random text
> </body>
> </html>
Somewhat crude, but I think thiw sill suffice:
preg_match_all('/[0-9]{1,3}(?:\.[0-9]{1,3}){3}:[0-9]+/',$html,$matches);
If you want to validate the IP adresses & portnumbers it's a whole other
game.
Grtz,
--
Rik Wasmus
Navigation:
[Reply to this message]
|