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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Remove all attributes related to event handling from inside HTML tags
Expression
(\s(\bon[a-zA-Z][a-z]+)\s?\=\s?[\'\"]?(javascript\:)?[\w\(\),\' ]*;?[\'\"]?)+
Description
No idea whether anyone would ever need this, but I had to work half a day on this pattern, so I decided to share it. :) It was never meant for productive use at all; it was rather to filter out all that annoying event handling stuff to find a bug in my DHTML table-generating script. Give it a try with this string (see details): <div id="TSelect_TD_value_911" class="TSel" onpaste="" onblur="TSelectClose(this);" onClick="TSelectOpen(this);" style="width:250px; padding:2px;">
Matches
onPaste onBlur onClick ... ; onblur onclick onpaste ...
Non-Matches
<div id="TSelect_TD_value_911" class="TSel" style="width:250px; padding:2px;">
Author Rating: The rating for this expression. globalplayer
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

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