Ok, here is a scenario, in pictures.


OK, so searching all files looks in 333 files, and finds 614 matches. First result is alex/init.zsh. Fine.

less scope

So I try to limit the scope a bit, with my logical regex of [^alex/init*]*. Great. Got fewer results, fewer files were searched, 1st result is different. Fine.

Wanting to eliminate all results in that alex directory.. I foolishly think that by just simplifying the regex that worked to [^alex/*]*, that ALL results that match tat expression will disappear. Wrong.


Instead of matching (or shall I say EXCLUDING) MORE files, it goes back to matching (excluding) NONE! This is the most simple example of frustrating results from this search interface... trust me I could show more!

Putting this question out there... in hopes that a solution to this simple problem will enlighten me to the correct syntax for more advanced searches!

  • I found this answer answer while googling for textmate2 find exclude directory. That answer provide a way to add exclude directory from textmate's settings. – Thu Yein Tun Sep 29 '15 at 15:04
  • @ZackTitan that's a little drastic. This is just for one-off searches. I just need to figure out Textmate's quirky regex for this.. Or maybe it's just a bug... – mralexgray Sep 29 '15 at 15:12
  • Oh, you want to eleminate the results which does not starts with Alex? Then it is your regex problem. Your regex is matching for strings starting with the text alex. Your regex should be Not starting with. So your [^alex/*]* would be something like ![^alex/*]*. Be advised you might have to adjust the regex a bit, since I'm not regex expert. I have only used regex in python and I do not know how textmate handle regex – Thu Yein Tun Sep 29 '15 at 15:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.