graff, based on your suggestion my script working pretty well now.
Thank you once again!
However, I'm not able to track down original pattern as $1 is no longer working as you suggested in first example.
print "\n$arg1\n$1\n";
I have 1000+ patterns and I will add more.
I need this scanner to fight against those bloody spammers.
See this example file, but with thousands of links and similar lines.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://test.com/index.html</loc>
<lastmod>2009-08-21</lastmod>
<changefreq>monthly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>http://test.com/page_1.html</loc>
<lastmod>2009-08-06</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>http://test.com/page_2.html</loc>
<lastmod>2009-08-10</lastmod>
<changefreq>monthly</changefreq>
<priority>0.4</priority>
</url>
I don't know why patterns like these (each on newline) will fail against this file. The script enter an interminable loop, using an entire cpu core.
<a href=.*<a href=.*poker
page.{0,10}.html.*page.{0,10}.html.*page.{0,10}.html.*map
When I change them to
<a href=.*<a href
page.{0,10}.html.*page.{0,10}.html.*page.{0,10}.html
working without problem.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.