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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Detect onClick Javascript in href tags
Expression
'/\\(?<\w+[^>]*\son\w+=.*[ \/].?>(?:\))?/i'
Description
Needed this to Detect onClick javascript in href tags and strip put with PHP scraping html source
Matches
<a href=\"#\" onclick=\"hideDesc('hidedescr1360823'); hideDesc('lessdescr1360823'); showDesc('descr11360823'); showDesc('moredescr1360823'); return false;\"><span class=\"grouptxt\">less</span></a> | (<img href=\"#\" onclick=\"showDesc('hidedescrtag1360823'); hideDesc('moredescrtag1360823'); hideDesc('descr1tag1360823'); showDesc('lessdescrtag1360823'); return false;\"><span class=\"grouptxt\">more</span></a>)
Non-Matches
<a href="#" ><span class="grouptxt">less</span></a>
Author Rating: Not yet rated. Rick Estrada
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-2018, RegexAdvice.com | ASP.NET Tutorials