Need Help for RegEx

Hi all,

I want regular expression for the following script:

<script language="javascript1.1" type="text/javascript">

<!--

cmCreatePageviewTag("checkout2/shippinginfo.tmpl", "850");

//-->

</script>

I want to print the whole data between <script>to</script>, I write a R.E. like this

<script.*>.*</script>

but it not works , it only prints the first line. It should print whole script. I think i am getting problem with new line characters. Can anyone please tell me what will be the R.E. for this . It should work for any script.

Please reply as soon as possible.

Thanx,

Vinayak

[677 byte] By [VinuRocksa] at [2007-11-27 10:20:04]
# 1

http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html

There you'll find things that could be of some help, such as :

- DOTALL flag

- reluctant quantifiers

TimTheEnchantora at 2007-7-28 17:01:28 > top of Java-index,Java Essentials,Java Programming...
# 2

Hi,

I didn't get your question. Why u want the text to be print and where you want to print. please let me know.

Regards,

Loga

Loga_07a at 2007-7-28 17:01:28 > top of Java-index,Java Essentials,Java Programming...
# 3

Pattern p = Pattern.compile("<script.*?>(.*?)</script>",

Pattern.DOTALL | Pattern.CASE_INSENSITIVE);

uncle_alicea at 2007-7-28 17:01:28 > top of Java-index,Java Essentials,Java Programming...
# 4

For Loga:

I want to print the the whole script , means starting from <script>upto</script>

Thanx

Vinayak

VinuRocksa at 2007-7-28 17:01:28 > top of Java-index,Java Essentials,Java Programming...
# 5

Hey uncle,

Thanx , it works

Thanx a lot.

Vinayak

VinuRocksa at 2007-7-28 17:01:28 > top of Java-index,Java Essentials,Java Programming...