Regular Expression: Markup Code

From: Date: Mon, 13 Sep 2004 20:04:44 +0000
Subject: Regular Expression: Markup Code
Groups: php.general 
Request: Send a blank email to php-general+get-196574@lists.php.net to get a copy of this message
Hello, would someone please help me with my regular expressions? They are so complex! Here is what I need to do. I have a string with contents similar to the following: <BLOCK NAME="TOP"> (a bunch of markup code) </BLOCK> <BLOCK NAME="BOTTOM"> (a bunch of markup code) </BLOCK> <BLOCK NAME="WAYOVERHERE"> (a bunch of markup code) </BLOCK> In other words, the name of the block is not known at runtime. They could be anything really! I need a way to parse through this string, and make new strings with names like $TOP, $BOTTOM, $WAYOVERHERE, that contain their markup code, but not the <BLOCK> tags. Any help would be greatly appreciated! -Samuel

« previous php.general (#196574) next »