A new SRC capture is found.

Source: Internet
Author: User

I felt that the three captures were not very good, so I studied how to use pre-query to achieve the judgment ..CodeAs follows...

<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> A new SRC capture was found, which was completed by a negative pre-query </title>
</Head>
<Body>
<Textarea id = "WC" style = "width: 500px; Height: 100px;">


'" src = 1.px>





</Textarea>
<SCRIPT type = "text/JavaScript">
/*
However, for efficiency, $1 $2 $3 is much better than $2, but it is only about % 14-% 8...
/]) +? Src = (['"]?) ([^ \ S> "'] * (? :(?! \ 1). [^ \ s> "'] *) \ 1 (? : "[^"] * "| '[^'] * '| [^"'>]) *>/Ig; // exact mode: $2
/]) +? Src = (? : "([^"] *) "| '([^'] *) '| ([^"' \ S>] *) (? : "[^"] * "| '[^'] * '| [^"'>]) *>/Ig; // exact mode: $1 $2 $3
/] *? Src = (['"]?) ([^ \ S> "'] * (? :(?! \ 1). [^ \ s> "'] *) \ 1 [^>] *>/ig; // get $2 in simple mode
/] *? Src = (? : "([^"] *) "| '([^'] *) '| ([^"' \ S>] *) [^>] *>/ig; // simple mode: $1 $2 $3
-In simple cases, the contents in SRC cannot be correctly captured. (3 quotation marks)
*/
VaR r =/]) +? Src = (['"]?) ([^ \ S> "'] * (? :(?! \ 1). [^ \ s> "'] *) \ 1 (? : "[^"] * "| '[^'] * '| [^"'>]) *>/Ig; // exact mode: $2

Document. getelementbyid ('wc '). value. Replace (R, function (L, $1, $2 ){
Alert (L + '\ NSRC = |' + $2 + '| ');
});
</SCRIPT>
</Body>
</Html>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.