In image-dired I use M-x image-dired-mark-tagged-files to mark files containing a tag using regexp. e.g. jan. The problem is that jane is marked as well.

What regex do I need to mark jan but not jane?



While jan\$ works in regexp-builder, it returns 0 results if used in M-x image-dired-mark-tagged-files


1 Answer 1


Try jan\b (in Lisp code, that's jan\\b).

That says to match jan when the n is on a word boundary.

  • Any ideas to match the tag bar but not not the tag foo bar? Tried \^bar. Will gladly open another question.
    – jjk
    May 3, 2022 at 6:05
  • 1
    One question per post, please. But you have to decide what exactly you want to exclude from matching before bar, and create a regexp that specifies that.
    – Drew
    May 3, 2022 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.