Improved RegExp to match out-parent-path pattern