You may swap the patterns in the first and second capturing group: sub("^(.*)_([^_]*)$", "\\2_\\1",String). See the regex demo. Details.
確定! 回上一頁