So at first look, your .innerHtml should be .innerHTML. Capitalize the HTML and then the .match will work correctly. That will return an array of everything that matches your regex.
We then loop over that and use .includes method to find any URL that includes what it is your trying to find in the URLs.
Keep in mind that .includes will find any string that INCLUDES what you specify so even your examples that say 'notexample' will also be return into this final array. If you change your 'notexample' to something that doesn't contain 'example', it should work fine.
const urlRegex = new RegExp(`((https?|):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])`, 'ig');
const urls = document.querySelector('div').innerHTML.match(urlRegex);
let selectedURLs = []
for (let i = 0; i < urls.length; i++) {
if (urls[i].includes('example')) {
selectedURLs.push(urls[i])
}
}
console.log(selectedURLs)