I have a database table which has HTML files for a bunch of language / user profiles. I would like to list all the javascript files that are being used in each data file, to create sort of a Javascript library index.
Here's my attempt so far:
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
The problem is that regexp_substr only returns one value, so I'm only getting one javascript per file as output even though I know that the files are filled with script tags that import javascript files. 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).
I would like to see all js files in my output for each file. Can somehow suggest a workaround please?
Thank you