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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details 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
   Displaying page 1 of 1 pages; Items 1 to 1

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