Quote:
Originally Posted by hacker
Speaking of regular expressions, here is one I wrote in my own perl web spider (used to fetch and convert webpages into Plucker format), that will strip Javascript and CSS style blocks from the page before it is parsed (since we don't deal with those elements, they're only taking up useless space in RAM at parse time, why not remove them!)
$content =~ s!<(s(?:cript|tyle))[^>]*>.*?</\1>!!gis
Works like a champ. Look at that beautiful backtracking and how I recycle the redundant parts of the regex, to combine two into one.
Perl++
|
Heh... nice one. Why not compete for the most complex regular expression