You are here: Re: Regex to get the <html></html> « PHP Programming Language « IT news, forums, messages
Re: Regex to get the <html></html>

Posted by gosha bine on 08/02/07 17:42

Rik wrote:
> DOM functions? <http://nl3.php.net/dom>

Yes, or a SAX parser like pear HTML_SAX. DOM is still too picky about
invalid html.

> I've taken a stab at it with regexes in the past, which works quite well
> as long as you can be sure it's stricly valid HTML. If it isn't, or
> you're using outside sources where this isn't known, don't use regular
> expressions for something a parser ought to be doing.

Yes, regexps suck as a parser, however in most cases you need just a
lexer and that's the job regexps do quite well.


--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok

 

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

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