connection: use same regexp for both CWD and PWD parsing