在plsql中使用regexp_substr返回多个匹配项

时间:2018-02-09 10:21:16

标签: plsql

我有一个数据库表,其中包含一堆语言/用户配置文件的HTML文件。我想列出每个数据文件中使用的所有javascript文件,以创建一个Javascript库索引。

到目前为止,这是我的尝试:

SELECT DISTINCT t.id,
   template_id,
   language_id,
   dbms_lob.substr(regexp_substr(x.data, '(src=\")+(\S)+(.js)',1,1),4000,1) javascript_file,
 FROM template t, template_language x
 WHERE t.id = x.template_id
   AND (regexp_like(x.data, '(src=\")+(\S)+(.js)', 'i'))
ORDER BY 1

问题是regexp_substr只返回一个值,所以我只得到每个文件一个javascript作为输出,即使我知道文件中填充了导入javascript文件的脚本标记。 In this screenshot you can see how I only get one js file as output per file while there are more js files with different names in my data fields (clobs)

我想在输出中查看每个文件的所有js文件。可以以某种方式建议解决方法吗?

谢谢

0 个答案:

没有答案