How does Spotlight search regex/other special characters?

2

1

I'm trying to find snippets of code in a bunch of velocity files using Spotlight (specifically pages that contain a <html> tag. Spotlight's missing pages that contain that tag that I know are there. Is there a way to escape characters in Spotlight? What are some good alternative search engines for Macs?

I saw this article - http://www.macworld.com/article/132788/2008/04/spotlight2.html - but it doesn't say anything about special characters, like periods or tags.

Kevin Burke

Posted 2010-07-29T22:54:47.380

Reputation: 809

Answers

1

If you don't mind using the terminal then you could perform a grep search

example:

grep --recursive "foo" ~/Desktop

This will provide you with a list of files containing the regex "foo".

This will only search in the Desktop folder and any subfolders. Additionally you can use the --line-number option to also get the number of the line which has been matched.

If you just want to find files by filename you could also use the "find" utility.

redxef

Posted 2010-07-29T22:54:47.380

Reputation: 161