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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Script Block Parser
Expression
<script(?:(?:.*(?<src>(?<=src=")[^"]*(?="))[^>]*)|[^>]*)>(?<content>(?:(?:\n|.)(?!(?:\n|.)<script))*)</script>
Description
This one enables you to parse well-formed script tags to get both the src value and the block content, if specified. I'm using this one in some AJAX where I get script blocks back in a text reponse and need to parse them and add them to the DOM so they get processed.
Matches
<script type="text/javascript" src="Test.js"></script>
Non-Matches
<script src=Test.js></script>
Author Rating: Not yet rated. Ambrose
Source dotNetTemplar
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-2024, RegexAdvice.com | ASP.NET Tutorials