note 56519 added to reference.pcre.pattern.syntax

From: Date: Tue, 06 Sep 2005 05:03:06 +0000
Subject: note 56519 added to reference.pcre.pattern.syntax
Groups: php.notes 
Request: Send a blank email to php-notes+get-94778@lists.php.net to get a copy of this message
wfinn, your example falls into one of the common traps, which is trying to parse a complicated language with a simple regex. Just try feeding it input containing a tag like <img class="match1" alt="<">. It'll die a horrible death. The main lesson here is "never parse HTML with a regex". The lesson for the advanced reader is "never use a regex where a parser is called for." ---- Manual Page -- http://www.php.net/manual/en/reference.pcre.pattern.syntax.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+56519 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56519&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56519&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56519&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56519&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56519&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56519&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+56519&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#94778) next »