Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ORACLE:SQL REGEXP\u SUBSTR,返回最后一个反斜杠(/)后的列值_Sql_Regex_Oracle_Regexp Substr - Fatal编程技术网

ORACLE:SQL REGEXP\u SUBSTR,返回最后一个反斜杠(/)后的列值

ORACLE:SQL REGEXP\u SUBSTR,返回最后一个反斜杠(/)后的列值,sql,regex,oracle,regexp-substr,Sql,Regex,Oracle,Regexp Substr,ORACLE:SQL REGEXP\u SUBSTR,返回最后一个反斜杠后的列值/ 例如: 预期值:1234此操作不需要正则表达式。您可以简单地使用substr和instr,它们可能执行得更快: select substr(col, instr(col, '/', -1) + 1) from t; 如果出于某种原因必须使用regexp\u substr,请使用: select regexp_substr(col, '[^/]+$') from t; 如果还需要使用REGEXP_SUBST

ORACLE:SQL REGEXP\u SUBSTR,返回最后一个反斜杠后的列值/

例如:
预期值:1234

此操作不需要正则表达式。您可以简单地使用substr和instr,它们可能执行得更快:

select
  substr(col, instr(col, '/', -1) + 1)
from t;
如果出于某种原因必须使用regexp\u substr,请使用:

select regexp_substr(col, '[^/]+$') from t;

如果还需要使用REGEXP_SUBSTR,则:

SELECT REGEXP_SUBSTR ('https://test/test/test/test/getTest/1234' , '[^/]+$' )  from dual