in reply to Re^2: Split/Match Question
in thread Split/Match Question
Returning the correct IP address (92.224.8.117 in this case) from this piece of HTML is not impossible, and with enough effort, someone may be able to write a regexp that does the job for this special obfuscation. But with HTML::Parser, it is essentially a no-brainer requiring about 10 lines of code.Sounds like a challenge....
I wrote this on my first try, and it seems to work:
Only two lines, and still a no-brainer. ;-)s{(?:<!(?:--[^-]*(?:-[^-]+)*--\s*)*>)|(?:</?\w[^"'>]*(?:(?:(?:"[^"]*") +|(?:'[^']*'))[^"'>]*)*>)}{}g; s{&#([0-9]+);}{chr $1}eg;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Split/Match Question
by afoken (Chancellor) on May 16, 2010 at 22:40 UTC |