Good question. Initially I had written it as +1 itself but then it went to an infinite loop. Then I noticed that after the position was found, I added a whitespace. So the actual length of the string increases by one and hence we have to start searching from +2 instead of +1 because +1 will return us back to the last found position.
pos+1 would work if you inserted whitespace AFTER finding position, but you would have to make sure that pos is not set to npos (when no match was found) by using another conditional.
Both have the same output but the first approach doesn't need the conditional ^_^