Skip to content

Search Window

doug24 edited this page Jun 29, 2026 · 23 revisions

The Search window is the main application window.

The toolbar at the top of the window provides access to: the Undo button (enabled after a replace operation), the Settings menu, the Scripts menu, the Bookmarks button, and the About menu.

Where to Search

The Search in section specifies the folder or file(s) to search. Click the browse (…) button to select a folder or files, or type the path directly into the text field.

Tips:

  • To search multiple folders or files at once, separate the paths with a comma or semicolon.
  • Drag and drop a folder from Windows Explorer onto the dnGrep window to set the search location. Hold Ctrl while dropping to add it to the existing search location rather than replacing it.
  • If the Folder field is empty and a directory path is on the clipboard, clicking the browse (…) button will automatically populate the field with that path.
  • You can use Windows wildcards (* and ?) in the Folder field to filter subfolders or files (in the last path segment only). For example, c:\results\log* will search only subfolders whose names start with "log".

File and Folder Name Filters

If the Patterns to match field is empty, all files are included in the search. Enter a filter pattern to restrict the search to specific file types. Multiple patterns can be separated by a semicolon or comma — for example: *.txt;*.xml;*.html

If the Patterns to exclude field is not empty, any files or folders matching that pattern are excluded from the search.

Patterns can be written as either Windows-style wildcards or regular expressions (for example, te[a-z]t-fil?.*). Use the selector in the file filters panel to switch between the two modes.

A shebang style filter can also be used when searching Unix scripts — for example: #!python;#!sh

Note: When a file (rather than a folder) is specified in the Folder field, the Patterns to match field is ignored.

Search in archives — Enable this option to search inside archive files (ZIP, RAR, 7z, and more).

File Filters

Click the More… button to reveal additional file filters beyond the path and extension filters.

The expanded filter panel includes the following options:

  • File size — Restricts the search to files within a specified size range.
  • Include subfolders — When enabled, files in subfolders are included in the search.
  • Max Depth — Sets the maximum folder depth to search.
  • Include hidden folders — When enabled, files in hidden subfolders are included.
  • Include binary files — When enabled, binary files are included in the search.
  • Follow symbolic links — When enabled, the search follows symbolic links to additional directories.
  • Date and time range — Filters files by creation time or last-modified time.
  • Pattern type — Sets whether the Patterns to match and Patterns to exclude fields use Regular expression, Wildcard, or Everything (the last option is shown only if Everything is installed).
  • Filter — Select a filter file to exclude files by pattern.
  • Use .gitignore (shown only if git is installed) — Excludes files and folders as specified in .gitignore.
  • Skip remote cloud storage files — Skips OneDrive and similar cloud-backed files.
  • Search parallel — Enables or disables multi-threaded searching.
  • Encoding — Specifies the file encoding to use. Defaults to "Auto detection".

What to Search For

The search panel is where you enter your search criteria and configure search behavior.

Search type

Choose one of the following search modes:

  • Regular expression — Match files using a regex pattern.
  • XPath — Match XML files using an XPath expression.
  • Text — Plain text search.
  • Fuzzy — Approximate string matching.
  • Byte — Search for specific byte sequences.

Search and replace fields

  • Search for — Enter the text, regular expression, or XPath query to search for.
  • Replace with — Enter the replacement text for use in a replace operation.
  • Bookmarks — Use the Bookmarks buttons to save the current search as a bookmark or associate the current search folder with an existing bookmark. See the Bookmarks section for details.

Tip: If you leave the Search for field empty, dnGrep will list all files matching the active file filter criteria. This behavior can be toggled in options.

Search options

  • Global — When enabled, returns all matches in each file. When disabled, returns only the first match per file. Applies to both Regular Expression and Plain Text searches.
  • Case sensitive — Controls whether matching is case-sensitive for plain text and regex searches.
  • Whole word — Restricts matches to whole words only.
  • Multiline — Allows the search pattern to span multiple lines. In regex mode, this enables the multiline flag in the regular expressions engine.
  • Match dot as newline — The "Singleline" option in .NET regular expressions. When set, a dot (.) matches any character including newlines.
  • Boolean operators — Combines multiple search patterns for Regex and Text searches.
  • Capture group search — Allows part of the filename to be used in the search pattern.

Searching with multiple patterns

You can supply multiple patterns using Boolean operators, or — for a large number of patterns — provide them in an input file. This works with both regular expression and plain text searches.

In the Search for field, enter the full path to a plain text file prefixed with file://, for example:

file://C:\testFiles\issue1142\searchfor.txt

Place each search pattern on its own line in the file. Empty lines are skipped. Comments and other non-pattern text are not supported. dnGrep will apply every pattern in the file and combine all matches into a single result set.

Search Results

Click Search to begin. Use the Pause and Cancel buttons to pause or stop the search at any time.

After a search completes:

  • A Search in results checkbox becomes available to restrict the next search to only the files in the current results.
  • The Replace button starts a replace operation — see the Replace section for details.
  • The Undo menu item rolls back a completed replace — see the Undo section for details.

The results panel offers two views, switchable via Enable details view in results tree in the Options dialog.

Details View

The Details view displays results in a list with columns for file information.

The Details view has eight columns:

Column Description
Path The relative path from the search directory, as shown in the Tree view.
Name The filename.
Matches The number of matches found in the file.
Read-only Indicates whether the file is read-only.
Size The file size.
Type The file type.
Date Modified The date and time the file was last modified.
Info Additional context — currently used for the Excel sheet name or the PowerPoint slide number.

Columns can be resized, sorted, and dragged to reorder. All column changes are saved to the dnGrep settings file. Sorting by column uses the same sort logic as the Sort menu. Right-click a column header to access a context menu with an option to resize all columns to fit their content.

Tip: Assign a keyboard shortcut to the Resize columns to fit action in the Keyboard dialog for quick access when the column widths need to be refreshed after a search.

Original Tree View

The original view displays results with file information in a compact view.

In either view, expand a file node to see its matching lines. Matched lines are shown with a configurable number of surrounding context lines in gray text. Line numbers appear on the left; gaps in the line sequence are indicated by a horizontal divider.

If the Preview file option is enabled, selecting a file or a matched line in either view opens it in the Preview Window.

Keyboard navigation:

  • F3 / Shift+F3 — Move to the next match / first match in the next file.
  • F4 / Shift+F4 — Move to the previous match / last match in the previous file.

Sorting results

Use the split Sort button to sort results. It provides several sorting options.

Additional actions

The More button provides additional file operations: Copy files, Move files, Delete files, File names to clipboard, and Save results. See the Custom Actions section for details.

Results display options

An expandable panel below the results tree lets you customize how results are displayed. Click the expander button to show or hide it. The available options are:

  • Highlight matches — Enables or disables background highlighting of matched text.
  • Highlight groups — When a regular expression contains capture groups, this option highlights each group distinctly.
  • Show context lines — Enables or disables the display of extra lines before and after each matched line. dnGrep always caches context lines, so you can toggle this on and off freely. If you never want context lines and want to avoid the caching overhead, set both "lines before" and "lines after" to zero.
  • Zoom — Adjusts the text size in the results panel.

Status bar

The status bar at the bottom of the window shows search/replace progress, the number of matching files, and the time taken. If any files could not be read (due to permission errors, locks, or other issues), an exclamation icon is displayed.

Clone this wiki locally