How to search in Org mode
Table of Contents
Learn a few tips and tricks to help you search keywords like a pro, and easily find information in your Org mode files.
For a simple search, type
C-c a s and then all the words you want for your
search (implicit "and"):
portable dvd player
Improve the quality of your search by using a number of advanced search techniques.
Find entries with…
An exact phrase – To do this, put the phrase in quotes:
Any of these words (explicit "or") – To do this, type a regexp (between curly brackets) using the "alternation" operator:
A phrase or regexp you don't want – To do this, put a minus sign in front:
Improve your results by…
- Adding new words you want (or don't want) using
- Adding new regexps you want (or don't want) using
Searching within tagged entries:
biking Italy :errands:
This does not cover inherited tags (use
Searching for terms appearing only in the headline (including tags):
Searching for terms appearing only in active todo entries:
Searching for exact terms only (no partial match):
:license registered nurse
will not match
You can mix several of the 3 last searches, if you put the signs
that order in front of the first search term.
Use regular expressions to search more precisely
Org keyword search supports the basic regular expressions, where most characters are treated as literals (they match only themselves) with the following exceptions:
- Matches any single character.
- Matches a single character contained within the brackets.
- Matches a single character not contained within the brackets.
- Matches the beginning of any line.
- Matches the end of any line.
- Groups alternatives.
- Matches the preceding element zero or more times.
- Matches the preceding element at least
3and not more than
It also supports some Perl extensions, such as:
- Matches a space character (to be precise, it matches all characters which are in the whitespace character class, see Emacs Syntax Table).
This page is based on Matt Lundin's Advanced searching document.