# Searches

- Search window
  - Calling up a search
  - Search location
- Search methods
- Using wild cards
- Using regular expressions
- Search results display

# Search window

## Calling up a search

OmegaT provides a powerful range of search functions. Call up the Search window with `Ctrl+F` and enter the word or phrase you wish to search for in the Search for box.

Alternatively, in the Editor window, select a word or phrase in the editing field (target text of the active segment) and hit `Ctrl+F`. The word or phrase is entered in the Search for box automatically in this case.

Calling up the Search window anew will create a new instance of the window. You may end up with a number of Search windows if you forget to close them.

## Search location

Searches occur both in the source as well as in the target section of the project. You may search in

- the project only (default setting)
- the project as well as in the reference translation memories in /tm/ (check Search TMs)
- a single file or a folder containing a set of files (check Search files)

In the latter case, OmegaT will only search the files it can read (See Supported File Formats).

# Search methods

Select the method using the radio buttons. You can choose between two methods to search:

exact search
  Search for segments containing of the string you specified.
keyword search
  Search for segments containing all keywords you specified, in any order.

For either of these two methods you can select the following three options:

case sensitive
  If selected, the search will be performed for the exact string specified; otherwise capitals will be ignored.
regular expressions
  If selected, the search string will be treated as a regular expression (in case of a keyword search it will be treated as multiple expressions).
search TMs
  if selected, all translation memories are included in the search.

An exact search looks for a phrase, i.e. if several words are entered, they are found only if they occur in exactly the same sequence. Exact searches are similar to an "exact phrase" search in an Internet search engine such as Google.

Select keyword search to search for any number of individual words, separated by spaces and in any order. OmegaT will display a list of all segments in which all the words occur. Keyword searches are similar to a search "with all of the words" in an Internet search engine such as Google (AND logic).

# Using wild cards

In both exact and keyword searches, the wild card search characters '`*`' and '`?`' can be used. To use wild cards, make sure the option regular expressions is not selected, otherwise these characters are interpreted as special regular expression characters.

The '*' character matches zero or more characters (the search term 'run*' would match 'run', 'runs', and 'running', for example).

The '?' character matches exactly one character ('run?' would match 'runs' and 'rung', for example, but not 'run' or 'running').

If you wish to search for segments containing either * or ?, you will need to switch on regular expressions, and escape these characters by prefixing a backslash ('\') to them, i.e. 'x\*y' to find instances of 'x*y' and 'x\?`y`' to find instances of '`x?y`'.

# Using regular expressions

A regular expression search is a powerful way to look for instances of a string. It is similar to a wild card search, but allows far more flexibility.

The regular expressions used in searches are those supported by Java. A short summary is available in the Regular Expressions Constructs appendix.

If you need more specific information, please consult http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html.

You can find simple tutorials on the web (http://www.regular-expressions.info/quickstart.html, for example.)

# Search results display

Pressing the search button after entering a string in the search field will display all the segments in the project that include the searched string. As OmegaT handles all the identical segments as one entity, only the first unique segment is shown.

The segments are displayed in order of appearance in the project. Translated segments will be displayed with the original text at the top and the translated text at the bottom, non translated segments will be displayed in original text only.

You may click on a segment to bring it up in the Editor for modification. Then you may switch back to Search window and go to the next found segment to modify it too. Such a pattern is useful to do terminology updates.

Legal notices