open I, "log1.txt"; while( ) { if( m!((?:http|ftp|https)://.*?)[\x00-\x20\]\<"]! ) { print O "$1\n"; } }