RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
(?<TAG>\s*<(?<TAG_NAME>\w*)\s+(?<PARAMETERS>(?<PARAMETER>(?<PARAMETER_NAME>\w*)(=["']?)(?<VALUE>[\w\W\d]*?)["']?)+)\s*/?>)
Description
Parse html tags to extract tag names and parameters with parameter name/value pairs.
Matches
<td valign="top" align="left" colspan="2">
Non-Matches
<!--dynamic_content GlobalID=49113-->
Author Rating: The rating for this expression. Maxim Paukov
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: php coding
Name: josé - [email protected]
Date: 9/28/2007 8:04:52 AM
Comment:
Praveen, you can use this: $regex = "/(?P<TAG>\s*<(?P<TAG_NAME>\w*)\s+(?P<PARAMETERS>(?P<PARAMETER>(?P<PARAMETER_NAME>\w*)(=[".chr(34).chr(39)."]?)(?P<VALUE>[\w\W\d]*?)[".chr(34).chr(39)."]?)+)\s*\/?>)/"; preg_match_all($regex, $conent, $array);


Title: It is nice code
Name: Praveen Prasoon
Date: 1/9/2007 6:21:42 AM
Comment:
Please let me know can i use it in PHP coding


Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials