user303907
user303907

Reputation: 563

Retrieving alert message regex

I have the following data sample.

<script language='javascript'>alert(Hello World!.');</script><script language='javascript'>alert(Goodbye World');</script><script language='javascript'>Disable();;</script><script type="text/javascript">window.scrollTo(0,450)</script>

And I have the following regex (?<=^|>)alert.*?(\(+?\))[^><]+?(?=<|$)

How do I retrieve the values inbetween alert()?

Thanks in advance.

Upvotes: 1

Views: 141

Answers (2)

zawhtut
zawhtut

Reputation: 8541

alert\("(.[^"]*)"\)

The only character not permitted is "

Upvotes: 0

Christophe Ebl&#233;
Christophe Ebl&#233;

Reputation: 8161

Hmm...why such a difficult one?

alert\((.+?)\)

Upvotes: 2

Related Questions