convert command line argument parsing to fully use regexps