Texpad offers powerful ways of searching within your projects. Along with the standard OS X in-file find and replace, Texpad provides two ways of searching your documents. Global search allows you to find and replace across all files in the current project and a convenient jump-to panel that allows you quickly get to various points of interest in your code.

## Global Search

Global search allows you search all documents in a workspace simultaneously.

### Getting started

Press Cmd-Shift-F or click in the search box on the toolbar to start a search. Once you have typed more than 2 characters of your search term, the search will start and a popover will appear with results as they are found. For a large document, this may take some time, especially when performing regex searches, and the results will be added as they are found.

## Regex Search

Some users may be familiar with Regular Expressions, often referred to as regexes. This is a special syntax for constructing complex text searches. This is not an introduction to Regular expressions, the Wikipedia page is a good place to start.

If you want to search by Regular Expression in Texpad, for example, the regular expression `string\s+theory`, type it into the search box enclosed in forward slashes, ie `/string\s+theory/`. Please note that applying complex regular expressions to a large document can take some time to return all results.

NB Texpad's Regular Expression engine is based on `icucore`, so it uses classical Unix syntax for Regular Expressions.

## Replacement

Once your results are displayed, you may want to replace some of them. To do this, type some replacement text in the box at the bottom of the search popover.

Select a result and press the `Replace` button to replace just that search result.

Press `Replace All` to replace all search results.

Please note that before any result is replaced, it will be compared to the original search term. It will only be replaced if it matches the original search term.

### Regex Replace

A useful feature of regular expressions is to capture groups. For example the regular expression `/how (\w+) you/` applied to `how are you` would capture `are` as group 1.

When replacing regex searches, you can insert group 1,2,3, etc. into the replacement string with `$1`, `$2`, `$3`, etc. So if you were to search for `/how (\w+) you/` and replace with `where $1 you?`, then `how are you` would become `where are you?`, `how were you` would become `where were you?` and so on.

### Keyboard Navigation

The search window is designed to be fully navigable via the keyboard.

- Cmd-Shift-F: open the global search window
- Esc: close the global search popover without clearing it, this allows you to press Cmd-Shift-F to return to where you started.
- &#8593, &#8595: The up and down arrows let you navigate the global search results.
- Enter: Press enter on a global search result to close the window and jump to that result in the text.

## Jump-to

The Jump to window will search all symbols in your document in a tolerant manner to help you navigate quickly to figures, files, citations, section titles and more.

### Getting started

Press Cmd-Shift-O to bring up the Jump To window. Type in the name of a section, a filename, a citation key, label key, or even a line number and the jump to window will display any partial or whole matches for that key. Click on the result to jump to it, or press Escape to leave the Jump To window.

### Keyboard Navigation

The jump to window is designed to be fully navigable via the keyboard, in fact it is designed primarily with the keyboard in mind.

- Cmd-Shift-O: open the jump to window
- Esc: close the jump to window.
- &#8593, &#8595: The up and down arrows let you navigate the jump results.
- Enter: Press enter on a global search result to close the window and jump to that result in the text.