
If no files are listed, then all are searched (except binaries and devices). Previously used patterns are available through the drop-down list. If you tend to scan through a tree of source code, a pattern like *.c *.cpp *.h may do the job. "Include Files" lists just those file patterns (Window-style file patterns) to search. If you have used the pattern before, it is available in the drop-down list. The "Search" pattern is a Perl-style regular expression. (Sorry, only one starting folder at a time and no wildcards.) You can Cut & Paste the folder name, or browse for it using the Select Folder button. If you have been there before, you can select the folder from a drop-down list. Basically, you select the starting folder for searching for files. How hard could that be? Just double-park, blast out the trivial amount of code, and be done with it.
#Grep for windows code
I found a number of programs here on Code Project that emulated grep or called grep from the command line, but while intriguing, were not what I wanted. This was agreeably fast, but had its problems such as no regular expressions, no context preview of matching lines, no way to open the matching file at the line of interest, etc.
#Grep for windows windows
The closest GUI I could find for searching through files was Windows Desktop Search. There's even a GUI for changing directories! (File Explorer) But staying in the Windows environment, I became very fond of the tendency to have a GUI for everything. So I have my productivity enhancing toolset back again. (Cygwin now says that they are emulating a Linux environment, but it looks like Unix to me). I subsequently discovered Cygwin-a large collection of Unix tools ported to the Windows environment.
#Grep for windows Pc
I had MKS Toolkit on my home PC but my company wasn't interested in spending that kind of money on me at work. When I changed jobs to my current employer, I found myself in a Microsoft shop I was a fish out of water. I come from a Unix background where the use of command-line tools rather than a GUI was the normal mode of operation. I strongly suggest installing Cygwin even if you have no interest in GrepWrap as it has hundreds of incredibly useful utilities running from the mundane awk program to a complete X-Windows server! And the price is right. Note: I do not include grep.exe in this article as it is freely available by installing Cygwin. However, I have looked at them and they do not meet my particular needs, although they seem to be fine utilities. In fact, until I started to write this article, I was only vaguely aware of some of these others. It has nothing to do with other programs with similar names, such as TortoisesVN grepWin or Windows Grep. Note: in the original version of this article, I was using the name GrepWin, which is the same as another tool by TortoisesVN. So my solution is GrepWrap, which is just a simple wrapper around GNU Grep. There was a match found on line 76 of MainFrm.cpp. The output has coloring and context to help identify the match. This is a recursive search in the current directory for C/C++ files, avoiding the Release and Debug directories, for the pattern ' toolbar.*color'.

exclude-dir='Release' -regexp='toolbar.*color' -include="*.cpp" \ binary-files=without-match -P -recursive -i -exclude-dir='Debug' \

Grep -with-filename -line-number -C2 -devices=skip -color=always \ The above is slightly more easily read as:

It just seemed that I was missing something. I have always found the command-line utility grep to be useful for brute-force searching of patterns in text files (especially code source!), but the number of options is daunting and when the search is finished, I always have to manually find the matching file and open it up and scroll to the correct line. Version 1.6 - Fixed a bug with files that don't have a default system handler.Version 1.5 - Added 'Programs' menu item to indicate location of grep.exe, misc cleanup.Version 1.4 - Replaced demo.zip with an installable (and new name).Version 1.3 - Initial inflicted upon release to CodeProject.Versions 1.0 to 1.2 - Personal use only versions.
