MacOS – How to use Regular Expressions in Spotlight on Mountain Lion

macossearchspotlight

How can I use Regular Expressions in Spotlight on Mountain Lion?

I want to use my knowledge of regular expressions to make my search results more exact.

Best Answer

Apple's tools for accessing the Spotlight index (Spotlight itself and the mdfind command) don't offer any regex options, nor do I know of any 3rd party tools that offer that (I'm not actually sure Apple has APIs that would make that possible).

However, the mdfind command does offer a much more powerful interface than the GUI Spotlight search. It offers proper binary operators and finer grained control over what metadata you search. Check out The Power of mdfind (via archive.org) for some good information, as well as the mdfind man page.