Skip to content

Find an exact phrase in your documents

To find an exact word or phrase, open Search, choose Grep, type the text in Pattern, and choose Run. Grep lists every passage in the Space’s PDF and Markdown files that contains that text. If your text includes punctuation such as . or (, first choose Filters and clear Regex, so every character matches itself.

Grep searches the same files as BM25: the PDF and Markdown files in the Space that have finished processing. For a PDF, it reads the text Mempipe extracted, the same text the Markdown view shows. Search inside your PDFs and Markdown files explains which files search covers.

  1. Open Search.

    In a Space, choose Search, the magnifying glass in the rail at the left edge. The panel opens in Grep mode.

  2. Enter the text.

    Type the word or phrase in Pattern, such as third-party software.

  3. Decide whether you need Regex.

    Regex is on when the panel opens, so some characters work as patterns instead of matching themselves: . * + ? ( ) [ ] { } | \ ^ $. If your text contains any of them, choose Filters and clear Regex.

  4. Run the search.

    Choose Run or press Enter.

  5. Read the results.

    Results are sorted by file path, then by position in the file. Each shows the file’s path, where the passage is (p.12 for a PDF page, L40 for a Markdown line), and the passage. Choose a result to open the file at that passage. When the count line says More available, choose Load more.

The count line also shows Candidate rows and either Index served or Scoped scan. They describe how the search ran, and you can ignore them.

The Search panel in Grep mode with Filters open, five results for third-party software, and a PDF passage containing it highlighted
Grep lists every passage that contains your text. Filters set letter case, patterns, and which files to search.

A match must fit inside one passage: a paragraph, heading, list item, table row, or code block. Grep reads the Markdown behind each passage, so formatting marks count, such as the ** around bold text and the address inside a link. In a PDF, a word split across two lines can lose its hyphen, so “third-party” may appear as “thirdparty”. If a phrase runs across two passages, or has bold text, a link, or a line break in the middle, search for a shorter part of it.

Choose how letter case matters under Filters, in Case:

  • Smart, the default. A pattern in lowercase ignores case, so trustworthy also finds “Trustworthy”. A pattern with a capital letter matches case exactly, so GOVERN does not find “govern”.
  • Sensitive. Case always matches exactly.
  • Insensitive. Case never matters.

With Regex on, Pattern is a regular expression, a short code that describes text to match. For example:

Pattern Finds
risk (tolerance|appetite) “risk tolerance” or “risk appetite”
GOVERN \d+\.\d+ IDs such as “GOVERN 1.1” and “GOVERN 4.2”
\bbias\b the word “bias”, but not “biased”

For the full pattern syntax, see Search, grep, and glob syntax.

Choose Filters to limit which files Grep reads:

  • Glob filter searches only files whose paths match a pattern, such as wiki/*.md or raw/**. Find a file by name explains patterns.
  • Path searches one file. Enter its full path, such as raw/NIST.AI.100-1.pdf.
  • File type searches one kind of file. Enter the extension without the dot, such as pdf or md.
  • Limit sets how many results each page shows, up to 1,000.
  • No results. No passage contains the text. Check the spelling and the Case setting. If the text includes punctuation, clear Regex and run it again. No results does not prove the text is absent: a file may still be processing, or formatting may split the phrase. Try a shorter part of it. Search results are missing or out of date has more checks.
  • invalid regex pattern. The pattern is not a valid regular expression. Fix it, or clear Regex to search for the text as typed.
  • pattern has no index-servable literal. The pattern is too vague to search the whole Space quickly. Make it include at least three letters or digits in a row that every match must contain, such as bias in \bbias\b. With Regex on, characters such as . and * are part of the pattern rather than text to find, so they don’t count. Or fill in Glob filter, Path, or File type to search fewer files.
  • Preparing recent uploads for search. A file you uploaded is still processing, so results may be incomplete. Wait a minute and run the search again.

For other messages, see Search inside your PDFs and Markdown files.