Close the input database file
Added initial regex matching
Added regex matching for -c and -o options