Skip to content

Working with Results

After a search, the search panel lists the matches below the search box. From there you can move to any match, read the capture groups of a regular expression, and copy or export the matching lines. For running a search, see Searching a file.

Each row in the results list shows where the match is and the text around it:

  • For a text search, the row shows the line number (Ln 1204) and a short piece of text on each side of the match, cut at the line ends. See Limits.
  • For a hex byte or strings search, the row shows the byte offset of the match in hexadecimal (0x0001F400) and the bytes or text around it.

Select a row to make it the current match. The viewer scrolls to it, and the row is highlighted in the list. F3 and Shift + F3 move through the same list.

The results list holds at most 10,000 matches. When a search finds more, Vaste keeps counting to the end of the file, and the status line shows Showing first 10,000 of followed by the total number of matches.

The limit applies to the parts of Vaste that work match by match:

  • The results list, and F3 and Shift + F3.
  • The match highlights in Text view.
  • The search markers beside the scrollbar.
  • Pinned results.

These features use every matching line, beyond the first 10,000 matches:

To see how many times a pattern occurs without listing the matches, use Count. See Count matches without listing them.

After a regular expression search, the search panel shows the capture groups of the current match below the status line. The heading shows the number of groups, including group $0. Select the heading to show or hide the list.

Each row shows the group number, the group’s name if the pattern names it, and the text the group captured. Group $0 is the whole match. Select a row to copy that text. A group that did not take part in the match shows (not matched). The list shows the first 20 groups and then +N more. A group’s text is cut off after 4,096 bytes, and selecting the row copies only that part.

For example, the pattern user=(?<name>\w+) took (\d+) ms on the line user=alice took 340 ms shows 3 capture groups: $0 with the whole match, $1 name with alice, and $2 with 340.

Sometimes Vaste cannot match the groups to the exact match it found. The heading then also shows approximate, and the groups can describe a slightly different match. Compare the $0 text with the highlighted match before you rely on the groups.

After a text search finishes, select More actions (…) in the search panel to show the actions row. It has two ways to get every line that contains a match:

  • Copy N matches copies the lines to the clipboard. The label counts matches, but Vaste copies lines, so a line with three matches is copied once.
  • Export… opens a save dialog, with matches.txt as the default name, and writes the lines to that file. When it finishes, the panel shows Exported N lines.

Select Ln# before you copy or export to start each line with its line number and a colon, for example 1204: followed by the line.

Both actions include every matching line in the file, not only the first 10,000 matches. In Grep view they still include only the matching lines, without the context lines.

Copy works for up to 10,000 matching lines. Above that, it copies nothing and the panel shows a message that starts with Too many matching lines. Use Export… for larger results.

Copy and export are not available for hex byte and strings searches.