def remaining_args(oldArgs, newArgList):
    pattern = r'\s+'.join(re.escape(a) for a in newArgList) + r'\s*$'
    matchObj = re.search(pattern, oldArgs)
    return oldArgs[matchObj.start():]
Preserves the spacing originally in the argument after
dataset/ETHPy150Open jookies/jasmin/jasmin/protocols/cli/options.py/remaining_args