set input = "2 2" set a = regexreplace(input,"^(-?\d+)\s+(-?\d+)+$","$1") set b = regexreplace(input,"^(-?\d+)\s+(-?\d+)+$","$2") echo a + b