add getopt options, change posix regex to PCRE