从oracle中的句子中提取单词

Extracting words from a sentence in oracle

我有 table 和 table 'test' 并且它有包含不同格式句子的文件名列。

filename                                                
LA West Employer us Rort October 2015.txt201510         
LA loyer sus Rrt April 2017         
LA oyer sus Rept April 2018.txt201712               
LA oyer sus Ret April 2019.txt201712                
LA Eoyer sus Ret Aug 2019.txt201712             
LA oyer sus Rort August 2017(2).txt201708           
LA Eyer sus Rort August 2018 (1).txt201712      
LA Eyer sus Reort Dec 2017.txt201711                
LA Emyer sus Report Dec 2018 (1).txt201712  
LA Emyer sus Report October- 2018 (1).txt201712     

我的预期输出是:

October 2015
April 2017
Aug 2019
Dec 2017

每一行都包含月份年份,我想从中提取那部分。

我试过如下:

SELECT
SubStr(filename,INSTR(filename,'Report')+7,(INSTR(filename,'(')-1)-(INSTR(filename,'Report')+7))res
FROM test ;

select regexp_substr(filename, '[^[:space:]]+[[:space:]][^[:space:]]+$') from table;

没有worked.How我能达到这个效果吗?

一个可能的解决方案是:

select replace(regexp_substr('LLC Emyer sus Report October- 2018 (1).txt201712', '[[:alpha:]-]+[[:space:]][[:digit:]]{4}'), '-', '')
  from dual;

这个模式也很好用

select FILENAME, regexp_substr(FILENAME, '([[:alpha:]]+\s+[[:digit:]]+)\s*(\([[:digit:]]+\))?\.txt.+?$', 1, 1, 'i', 1) expected_output
from your_table