Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What regular expression will match specific HTML tags?

Status
Not open for further replies.

Smapty

Programmer
Mar 12, 2005
55
0
0
US
I need a reliable regular expression that will match a specific html tag but will ignore the tag if it has a specific attribute/property in place.

For example, I need to turn this:
Code:
<ul>
<li><html:link action="give.up"></li>
<li><html:link action="give.up"></li>
<li><html:link
action="give.up"></li>
<li><html:link action="give.up" onclick="ask4help();"></li>
<li><html:link action="give.up" onclick="ask4help();" ></li>
</ul>

Into this...

Code:
<ul>
<li><html:link action="give.up" onclick="ask4help();"></li>
<li><html:link
action="give.up" onclick="ask4help();"></li>
<li><html:link action="give.up" onclick="ask4help();"></li>
<li><html:link action="give.up" onclick="ask4help();"></li>
<li><html:link action="give.up" onclick="ask4help();" ></li>
</ul>
 
Are you kidding? In this (I'm sure limited) example, you could replace
Code:
action="give.up">
with
Code:
action="give.up" onclick="ask4help();">

But, seriously, this probably isn't the forum to ask about regular expressions. [dazed]

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Ok, but Were not sure the order of the attributes of these tags. Also, the action type vary's widely across the website.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top