}

Silver Searcher (ag): Can't search for dollar sign, even when escaped.

Created:

The problem: double quotes

I tried searching my project for the angularJS service $timeout using ag. I tried the following:

$ ag "\$timeout"

However no results were returned.

Cause of the problem is that you're using double quotes, you're only escaping the dollar sign..

Solution 1: Single quotes

ag '\$timeout'

Solution 1: Proper escape

$ ag "\\\$timeout"