| 
	
 | 
 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] 
 |