Does anyone now how I can achieve the following:
I want to parse the contents of a file and extract the <script> tags.
I'm currently using the following code:
    var scripts=/<script>\s*(.*)\s*<\/script>/i.exec(contents); // where
contents = file contents

If there is only one <script> tag everything works fine.  If there are
two, the result is stuffed.
e.g..
    var contents = "<script> alert('test 1') </script> test html
<script> alert('test 2') </script>";

scripts returns "alert('test 1') </script> test html <script>
alert('test 2')"

It should have returned and array of elements containing each of the
individual script tags code.

Any help would be greatly appreciated, thanx.

--
Michael Pemberton
[EMAIL PROTECTED]
ICQ: 12107010




_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to