#!/usr/bin/env python
# $Id: pystrings-esxi4,v 1.1 2018/10/05 22:57:43 friedman Exp $

# This was written to work in python 2.5 (and possibly earlier) for ESXi 4.x.
# Thus no fileinput module, no 'as' keyword, no __future__ print_function.

import sys
import re

pattern = re.compile( '([\x20-\x7e\t]{4,})' )

for file_name in sys.argv[1:] or ['-']:
    try:
        if file_name == '-':
            fh = sys.stdin
        else:
            fh = open( file_name, 'r' )
            buf = fh.read()
        if fh is not sys.stdin:
            fh.close()
    except IOError, e:
        print >> sys.stderr, e
        continue
    for match in pattern.findall( buf ):
        print( match )

# eof
