I'm going to go for a nice and simple:
String element = "<img src='https://...' data-custom:'delete'/>";
String attributeRemoved = element.replaceAll("data-custom:['|\"].+['|\"]", "");
Updated based on comment
If you want to remove the whole tag you can do this:
String elementRemoved = element.replaceAll("<.*data-custom:['|\"].+['|\"].*>", "");
If you only want to do it for <img>
tags you can do:
String imgElementRemoved = element.replaceAll("<img.*data-custom:['|\"].+['|\"].*>", "");
A much more reliable way would be to parse the HTML as an XML document and use XPath to find all elements with a data-custom attribute and remove them from the document, then save the updated document. While you can do this stuff with regex, it's not normally a good idea...