Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/72.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
用于提取以后缀(.sh.py等)结尾的单词的oracle sql正则表达式_Sql_Regex_Oracle - Fatal编程技术网

用于提取以后缀(.sh.py等)结尾的单词的oracle sql正则表达式

用于提取以后缀(.sh.py等)结尾的单词的oracle sql正则表达式,sql,regex,oracle,Sql,Regex,Oracle,有人可以帮助Oracle正则表达式提取字符串中以.sql、.sh或.py结尾的单词吗。例如: sh /path/myscript.sh arg1 arg2 我正在寻找一种使用SQL提取myscript.sh的方法 做很多假设看看原始帖子下面我给你的问题,也许你所需要的就是 select regexp_substr( your_input, '[[:alpha:]]+\.[[:alpha:]]+') from your_table -- or from wherever 请注意,句点是

有人可以帮助Oracle正则表达式提取字符串中以.sql、.sh或.py结尾的单词吗。例如:

sh /path/myscript.sh arg1 arg2

我正在寻找一种使用SQL提取myscript.sh的方法

做很多假设看看原始帖子下面我给你的问题,也许你所需要的就是

select regexp_substr( your_input, '[[:alpha:]]+\.[[:alpha:]]+')
from   your_table   -- or from wherever

请注意,句点是转义的,因此它表示文字句点。其余的应该是不言自明的。

单词和后缀不是定义良好的术语。您是否希望提取由字母、句点和多个字母组成的子字符串?在句点的每一侧至少提取一个字母?如果有数字,字母或数字也应该被视为数字吗?如果输入中有多个这样的内容,该怎么办?另外:后缀必须是sql、sh或py,或者任何后缀?