$counter = 0; $textfile = "rfl.txt"; open (TEXT, "$textfile") || die "Con't Open $textfile"; @text=<TEXT>; close(TEXT); $glob = @text; for($i=0; $i<$glob; $i++){ $_ = @text[$i]; if(/eid=/){ $counter = 1 - $counter; print $_ if $counter; } }
Example Text: 'junk' website: http://www.jxxxxx.com/ > Additional links on www.jxxxxx.com: > http://www.jxxxxx.com/ > http://www.jxxxddd.com/> http://www.jtrsss.com/redir.asp?id=7446&email=murad@webtv.net > http://www.jaxost.com/unsubscribe.asp?eid=3701&customer=murrad@webtv +.net > http://www.jaceee.com/redir.asp?id=7445&email=murad@webtv.net Fri, 20 Jul 2001 'more junk' Example Output: f=http://www.jxxxx.com/bp_unsubscribe.asp?eid=3711&customer=x> <A href=http://www.jadssss.com/unsubscribe.asp?eid=3716&customer=x>her +e</a> If you would rather not receive these messages, please unsubscribe at: +<br>< Wished it was: http://www.jxdsl.com/bp_unsubscribe.asp? http://www.jxxxx.com/bp_unsubscribe.asp? http://www.jxrexx.com/bp_unsubscribe.asp?
In reply to Cleaning Regexp by amearse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |