I have a table named 'Articles' that has some rows, inside each row has some image tag that I want to return all of those.
I used this query but it only returns one of those tags per row. And other lines are returned empty.
SELECT REGEXP_SUBSTR(body, '([0-9])+\.(jpg|png|gpeg)') from articles;
Article 1:
<img src"54545343.png" />
<img src"24352445.png" />
<img src"24352435.png" />
article 2:
<img src"24352435.png" />
article 3:
...
I want all of these images.
thank you for your help
UPDATE version 10.4.19-MariaDB

You could use a "dirty solution" like this, but it is horribly inefficient:
The fourth parameter to
REGEXP_SUBSTRis:The above query tries to retrieve occurrences 1 - 10.
This is probably a good example of
but you could use a stored function to extract the content of the image src attributes:
And then the following query:
And here's a db<>fiddle.
Note: the above stored function expects
src="..."and will not work with single quotes or spaces either side of the=. It will also fail if there is a>anywhere inside the<img>.