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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Detect Javascript
Expression
<script.*/*>|</script>|<[a-zA-Z][^>]*=['"]+javascript:\w+.*['"]+>|<\w+[^>]*\son\w+=.*[ /]*>
Description
Matches any opening or closing script tags, inline javascript: tags, inline on<function> (ex: onClick) tags. MATCHES: <a href="javascript:alert('test0');"> <a href='javascript:alert("test1");'> <a href="#" onClick="alert('test2');" /> <script language="javascript" src="somewhere.js"> <script language="javascript" src="somewhere.js" /> <script> </script>
Matches
<a href="javascript:alert('test0');"> or <a href="#" onClick="alert('test');" /> etc...
Non-Matches
This should not appear because in javascript: you can use the < operator or the > operator.
Author Rating: Not yet rated. Denny Love
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: very nice
Name: stagl
Date: 10/15/2009 1:00:43 PM
Comment:
well thought out!


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