RE: [PHP] REGEX for tag attributes?
| From: | Robert Collins | Date: | Wed, 17 Jan 2001 17:48:54 +0000 |
| Subject: | RE: [PHP] REGEX for tag attributes? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-35087@lists.php.net to get a copy of this message | ||
Thomas,
Not sure if this si what you want but it may start you in the right
direction.
<?
$bob = "<div key1=val1 key2 = val2 key3='val3' key4 =
\"val4\">";
preg_match_all( '/\S*\s?=\s?\S+[^>]/', $bob, $match );
foreach ($match[0] as $match_result) {
echo $match_result."<BR>";
}
?>
Robert W. Collins
Web Developer II
Insight / TC Computers
www.insight.com
www.tccomputers.com
-----Original Message-----
From: Thomas Angst [mailto:ta_php@granitsoft.ch]
Sent: Monday, January 15, 2001 5:47 AM
To: php-general@lists.php.net
Subject: [PHP] REGEX for tag attributes?
Howdy,
I need to divide several attributes of a tag.
<div key1=val1 key2 = val2 key3='val3' key4 = "val4">
how can I do this without too many time lost?
Is it possible to do this with a regular expression?
Thomas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net