Click here to Skip to main content
15,031,368 members
Articles / Programming Languages / C++
Posted 12 Oct 2000


46 bookmarked

Agent Ransack - File searching utility that supports Regular expressions

Rate me:
Please Sign up or sign in to vote.
4.63/5 (7 votes)
12 Oct 2000
File, searching, regular, expression, GREP, tool, utility
  • Download source files - 978 Kb
  • Introduction

    How many times do you find yourself plowing through files looking for that illusive line of code whether it is a method declaration, function call, or algorithm etc.? If you're anything like me it's all the time and you may therefore find this FREE utility, Agent Ransack, very useful. 

    Agent Ransack searches through files, text or otherwise, fast and efficiently. When searching the contents of files for code, or other text, Agent Ransack displays the text found so you can quickly browse the results without having to separately open each file!

    Basic Example

    Shown below is an example of searching for the Format method of CString in the MFC source directory. 

    Image 1

    The example shows a few important features:

    Regular expressions: The filename field uses a regular expression to search through all files with a .cpp or .h extension. Regular expressions can be used in both the file name and the contents field. If you would rather use DOS style expressions then there is an 'Auto convert to DOS' option. If you are not familiar with regular expressions but would still like to use them there is an Expression Wizard to help you build the expression.

    Immediate browseable results: As soon as a file is found it is available for browsing, even if the search has not yet finished. The browser allows you to view the lines that were found without having to open the file separately.

    A more complicated example

    Have you ever written if (nValue = NULL) when you meant to write

     if (nValue
    == NULL)
    ? Hmm, only me huh? The following example shows how to look through your code for any line that has an if with only a single = within the parentheses.

     Image 2

    You can then quickly run through the results checking each occurrence.


    While this was a bit of a whirlwind tour of Agent Ransack I hope it inspires you to give it a try and check out the help file for a more detailed description of it's features. Other features include: Print/Print preview, Search saving, File context menu, Basic interface option, match case, regular expression tester, and many more. I hope Agent Ransack saves you many hours of frustrated searching!

    For further information please visit our website at


    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here


    About the Author

    David Vest
    Founder Mythicsoft Ltd
    United Kingdom United Kingdom
    Dave has been writing software since the age of nine when he received his first computer, the Sinclair ZX81 with a rather limiting 1K of RAM. Since then (many computers, with significantly more RAM, later) Dave has spent a lot of time working with 6502 assembly, C, C++, STL/MFC/ATL, COM, C#, ASP.NET, PowerBuilder, MS SQL Server and Sybase databases.

    After working for various organizations in the UK, USA, Bosnia and Switzerland Dave founded Mythicsoft Ltd which sells high performance file searching solutions.

    Comments and Discussions

    QuestionCrash in Windows 8.1 Pin
    Sivaji156525-Feb-14 17:51
    MemberSivaji156525-Feb-14 17:51 
    AnswerRe: Crash in Windows 8.1 Pin
    David Vest11-Aug-14 1:40
    MemberDavid Vest11-Aug-14 1:40 
    GeneralMy vote of 5 Pin
    Sivaji156525-Feb-14 17:45
    MemberSivaji156525-Feb-14 17:45 
    Generalthank you Pin
    Josef Manurung21-Mar-10 23:09
    MemberJosef Manurung21-Mar-10 23:09 
    GeneralPossibly small but great enhancements Pin
    ccoder00728-Jun-09 11:28
    Memberccoder00728-Jun-09 11:28 
    QuestionAccessing by code Pin
    S Sansanwal23-May-07 11:57
    MemberS Sansanwal23-May-07 11:57 
    Generalget the line containing particular text Pin
    chintan_4948-Apr-04 21:39
    Memberchintan_4948-Apr-04 21:39 
    Generalget the line containing particular text Pin
    chintan_4948-Apr-04 21:39
    Memberchintan_4948-Apr-04 21:39 
    GeneralTo = or not == Pin
    Dave Cross8-Nov-03 23:17
    professionalDave Cross8-Nov-03 23:17 
    GeneralThanks you! Pin
    John R. Shaw7-Jul-03 14:48
    MemberJohn R. Shaw7-Jul-03 14:48 
    GeneralText display errors Pin
    Rick York16-Dec-02 7:18
    mveRick York16-Dec-02 7:18 
    GeneralFile identification Pin
    Raks11-Dec-02 10:04
    MemberRaks11-Dec-02 10:04 
    GeneralLogical AND Pin
    Mads M.P.2-Aug-02 2:16
    MemberMads M.P.2-Aug-02 2:16 
    GeneralRe: Logical AND Pin
    David Vest2-Aug-02 3:00
    MemberDavid Vest2-Aug-02 3:00 
    GeneralRe: Logical AND Pin
    Mads M.P.2-Aug-02 14:39
    MemberMads M.P.2-Aug-02 14:39 
    GeneralNice one Pin
    Jobie28-Feb-02 4:35
    MemberJobie28-Feb-02 4:35 
    GeneralFirst test failed Pin
    Anonymous3-Nov-00 4:43
    MemberAnonymous3-Nov-00 4:43 
    GeneralRe: First test failed Pin
    David Vest3-Nov-00 5:58
    MemberDavid Vest3-Nov-00 5:58 
    GeneralWonderful! Pin
    Abu Wawda1-Nov-00 20:01
    MemberAbu Wawda1-Nov-00 20:01 
    GeneralNEW VERSION 1.5.0 Pin
    Dave Vest30-Oct-00 11:35
    sussDave Vest30-Oct-00 11:35 
    GeneralReplace were great Pin
    Christian Rodemeyer16-Oct-00 20:40
    professionalChristian Rodemeyer16-Oct-00 20:40 
    This would be a REAL good utility, if some future versions would support a "search and replace" feature. This is the one thing I desperately miss in VC-IDE every day.

    PS: If this were open source, I had added this feature by myself ;-
    GeneralRe: Replace were great Pin
    Philippe Lhoste16-Oct-00 23:33
    MemberPhilippe Lhoste16-Oct-00 23:33 
    GeneralRe: Replace were great Pin
    developer17-Oct-00 3:23
    Memberdeveloper17-Oct-00 3:23 
    GeneralRe: Replace were great Pin
    Dave Vest17-Oct-00 2:40
    sussDave Vest17-Oct-00 2:40 
    QuestionWhat RegExp Library are you using? Pin
    Uwe Keim13-Oct-00 22:13
    sitebuilderUwe Keim13-Oct-00 22:13 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.