You are here: Re: Parsing txt file « PHP Programming Language « IT news, forums, messages
Re: Parsing txt file

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация