正则表达式实现字符串换位吗

能用正则表达式实现字符串换位吗

John, Smith 变成 Smith John

Solution:

SQL> select regexp_replace('John, Smith','^([^,*]{1,}),([^,*]{1,})','\2 \1') from dual;
REGEXP_REPLACE('JOHN,SMITH','^
------------------------------
Smith John

原文地址:https://www.cnblogs.com/tracy/p/2042987.html