Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

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 for some good information, as well as the mdfind man page.

share|improve this answer
add comment

I found a couple alternatives to Spotlight that allow for more control over your searches. Like the mdfind command the Canuck suggested, some of the tools enable you to use boolean operators.


Alternative 1: Find Any File

enter image description here

Find any file is very basic when you first look at it, but once you click the "More Choices" button, many more options pop up so you can refine the search by including more parameters like those seen in the image of a menu: enter image description here


Alternative 2: NotLight

enter image description here

Although I prefer NotLight to Spotlight, it's search is not as powerful as that of Find Any File and you're not given as many parameters to search by. However, you can search within a specific folder, which is a useful feature.


Alternative 3: EasyFind

enter image description here

EasyFind is by far the most user friendly Spotlight alternative and has the nicest user interface. It is better then NotLight, but does lack some of the functionality of Find Any File. However, if you're the average user and are not looking for incredibly specific search capabilities, then this would probably be the best option.


Hope you found some of these tools useful!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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