Ah, i think I missed the “pasted” aspect of the images before. My apologies! You will not be able to exclude those in “Excluded Files” since that works on folder and note names, not note content. Search query operators like line:(...) work on note contents. Have you tried using - in the search bar - something like -line(data:image/png.base64) along with your query?
One thing I don’t know with the above suggestion is what the behavior will be if you have somewhere in your file your search term and somewhere else in your file an image. I think perhaps they will be excluded too, and I am not sure off the top of my head a way around this. The link I posted previously has documentation that may help.
Another idea would be - if your query is a word that you expect to have spaces around it to add the spaces around the query e.g. " API ", since there do not seem to be spaces in the base64 encoding. This might get complicated quickly if instead of a space you expect a linebreak or punctuation though. Maybe @I-d-as has a regular expression that could help here? Also pinging @CawlinTeffid for another search question. Hopefully someone can find a solution!
@scholarInTraining Thanks for the thought. I appreciate the challenge, and would be happy to help the best I can. I am wondering whether it might help to isolate all of these images and all the notes that have the base64 encoding within a note and image subfolder with a single folder that you can completely exclude without the need for any regex. Then, within notes where you want to embed one of the encoded images, you could instead just embed one of the notes from that excluded folder which itself has an embedded encoded image within it. This way you aren’t getting what appear to be coincidental matches of certain sequences of characters if I am understanding correctly. It appears that search matched “api” 245 times within that note where you have some of these images. So by creating a layer of separation, perhaps this could be avoided.
I am also wondering whether there might be an issue with the regex that was used. Maybe @megadiddly could provide a screenshot so we could better check what is or isn’t working correctly.