(#6972) Clean up OptParse name extraction a little.
During testing, an obvious cleanup showed up for the name extraction here, so
we implement it. This extends the regexp to better extract the data we want
rather than hacking it up post-match and having to do extra validation to make
sure it actually worked.
Reviewed-By: Dan Bode <dan@puppetlabs.com>