Search menu

From TED Notepad
(Redirected from Control:Menu:Search)
Jump to: navigation, search
This section is up to date for TED Notepad version 6.1.1.0.
Control page Control:menu:Search menu
This section is up to date for TED Notepad version 6.1.1.0.
Control page Control:menu:Search


Primary and secondary search

TED Notepad provides two separate sets of search and replace in order to be able to search for two different things alternately.

The Search dialog provides a Use 2nd search option and the user can switch between a primary search and a secondary search whenever necessary. Both primary search and secondary search are fully featured searching mechanisms and they are equivalent in terms of behaviour and capability.

The only difference between primary search and secondary search is that they keep track of history separately. Therefore, one search phrase can be used with the primary search while a different search phrase can be set for secondary search. And both these phrases are remembered separatelly, even between separate sessions.

Both primary search and secondary search offer their own set of hotkeys. While hotkey Alt+F3 modifies and then uses the primary search, hotkey Alt+F2 modifies and then uses the secondary search. One can even alternate hotkey F3 and hotkey F2 to search for two different things alternately.

Note: Hotkey Ctrl+F opens the Search dialog with Use 2nd search option automatically turned off, while hotkey Ctrl+U opens the dialog with Use 2nd search option automatically turned on, for user convenience.

Note: See chapter Search page of the Settings dialog for information on how to tweak the search.

Find.. (Ctrl+F)

Shows the Search dialog at the bottom of the window, also called the Search bar. After entering search conditions, searches for specified Find phrase within the document.

Tip: Several settings in the Settings dialog can alter, what phrase and options are preloaded into the Search dialog upon invoking. See chapter Search page of the Settings dialog.

Match case option can be used to match case upon searching. By default, character case is ignored upon searching.

Whole words option can be used to check for word boundaries upon searching, i.e. a phrase is located in the document only if no word letters are found directly before and after the phrase, and the phrase begins and ends with word letters.

Versions note: Prior to version 6.0, only characters directly before and after the phrase were checked. Since version 6.0, phrase beginning and end is checked as well. So, if searching for whole words, the phrase itself must start and end with a word.

Escapes option can be used to allow entering newlines and Tab characters into the Find phrase. Use \n sequence to encode a newline, use \t to encode a Tab character, and use \\ to encode a simple backslash (\) character wherever a confusion with other escapes could arise.

Note: A newline escape (\n) matches any kind of newline (Windows, Unix, Mac). A newline escape matches exactly one newline, i.e. use \n\n in order to match two consecutive newlines, etc.

RegExps option can be used to turn the Regular expressions engine on. When Regular expressions are enabled, Find is parsed as a regular expression pattern. See chapter Regular expressions for more details on supported regular expressions syntax.

Note: Since regular expressions can take a long time to find match, Esc can be used to interrupt a search.

Wrap around option can be used to allow searching even beyond the edge of the document. If the search encounters the end or the beginning of the document, it automatically wraps around the document edge and continues from the beginning or the end of the document respectively.

Versions note: Prior to version 6.0, this option was available within the Settings dialog. It has been moved to Search dialog in version 6.0 for convenience.

Use 2nd search option can be used to switch between entering primary search and secondary search. Whenever searching, search phrase and search options are automatically remembered into either primary search or into secondary search, and can be re-used later, for example by Find Next (using primary search) or Look for Next (using secondary search) respectively. Most available search commands are coupled this way, e.g. Find Previous and Look for Previous, Find Selected and Look for Selected, Find Later and Look for Later, etc.

Versions note: Prior to version 6.0, this option was not available and the Search dialog was restricted to the primary search only.

Buttons Next and Previous can be used to search downwards or upwards from the current position. Several hotkeys are available in the Search dialog as well as described below.

Note: Works with the primary search definition, unless Use 2nd search option specifies otherwise.

Search bar hotkeys

Following hotkeys are available in both Search dialog and Search and Replace dialog (well, they both kinda look the same, don't they :), however, some of them work only if controls of the Search dialog part are focused, e.g. Find editbox, Match case option, or some other option.

Using primary search or secondary search correspondingly to option Use 2nd search:

  • Enter — Search downwards. (Search dialog part only)
  • Ctrl+Enter — Search upwards. (Search dialog part only)
  • Shift+Enter — Search downwards from the beginning of the document.
  • Ctrl+Shift+Enter — Search upwards from the end of the document.

Using primary search directly. Note: All these hotkeys automatically turn the Use 2nd search option off:

  • F3 — Search downwards.
  • Ctrl+F3 — Search upwards.
  • Shift+F3 — Search downwards, select text along.
  • Ctrl+Shift+F3 — Search upwards, select text along.

Using secondary search directly. Note: All these hotkeys automatically turn the Use 2nd search option on:

  • F2 — Search downwards.
  • Ctrl+F2 — Search upwards.
  • Shift+F2 — Search downwards, select text along.
  • Ctrl+Shift+F2 — Search upwards, select text along.

Find Next (F3)

Searches for the next occurrence of the recently specified search within the document. If no search was specified yet, shows the Search dialog.

Note: Works with the primary search definition.

Find Previous (Ctrl+F3)

Searches for the previous occurrence of the recently specified search within the document. If no search was specified yet, shows the Search dialog.

Note: Works with the primary search definition.

Find Selected (Alt+F3)

Sets the search, then searches for the next occurrence, using Find Next.

Sets Find to content of the selection, turns off Match case, Whole words and RegExps options, and selects Escapes option if it is required by the nature of the selection content.

Note: Works with the primary search definition.

Tip: There are no restrictions on what the selection may or may not contain. You can select text over multiple lines and start a search for multi-line phrase.

Find Later (Alt+Ctrl+F)

Sets the search like Find Selected, but does not search for the occurrence.

Sets Find to content of the selection, turns off Match case, Whole words and RegExps options, and selects Escapes option if it is required by the nature of the selection content.

Note: Works with the primary search definition.

Tip: There are no restrictions on what the selection may or may not contain. You can select text over multiple lines and start a search for multi-line phrase.

Select to Next (Shift+F3)

Searches for the next occurrence of the recently specified search, using Find Next. If successful, extends the current selection to cover the found match.

Note: Works with the primary search definition.

Select to Previous (Ctrl+Shift+F3)

Searches for the previous occurrence of the recently specified search, using Find Previous. If successful, extends the current selection to cover the found match.

Note: Works with the primary search definition.

Replace.. (Ctrl+R) (Ctrl+H)

Shows the Search and Replace dialog at the bottom of the window, which is an extension to the Search dialog, also called the Search bar. After entering search and replace conditions, searches for specified Find phrase within the document and replaces found occurrence with Replace phrase.

Note: See Search dialog for description and information about available search conditions and options inherited here from Search dialog. Following are only options exclusive to the Replace dialog part.

Mimic case option can be used to modify character case of the replacement upon replacing an occurrence. For each occurrence, the actual character case of the match is examined, and then the respective replacement string is converted to imitate (mimic) such case. It is important to understand that each match and its replacement is examined and converted independently. It means that the original Replace phrase is never modified in this process, but it also means that (with regular expressions) back-references may also get converted based on respective matches.

Replace button first verifies that the current selection matches the given search conditions, then either replaces it with Replace phrase, or if current selection does not match the search, searches for the next occurrence instead of replacing. This behaviour ensures that only matching pieces ever get replaced. After successful replacement, automatically searches for any next occurrence.

Replace All button starts searching at the beginning of the document and replaces every match found throughout the entire document. Note: Since searching and replacing throughout the entire document can take a very long time, Esc can be used to interrupt the process at any time.

Tip: To Replace All in documents where too many occurrences are expected, or to Replace All within selection only, use much faster and selection-oriented Extended Replace tool (hotkey Alt+Ctrl+R). See chapter Text tools. There are also other advantages in Extended Replace tool over the more classic Replace All command, e.g. the Extended Replace tool offers much bigger dialog fields for entering search and replace phrases.

Note: Works with the primary search definition, unless Use 2nd search option specifies otherwise.

Tip: If you need to replace individual characters for other characters, for examle, to get rid of encoding or punctuation, use the Translate Characters tool instead (hotkey Alt+Ctrl+T). See chapter Text tools.

Search bar hotkeys

Following hotkeys are available in both Search dialog and Search and Replace dialog (well, they both kinda look the same, don't they :), however, some of them work only if controls of the Replace dialog part are focused, e.g. Replace editbox or Mimic case option.

Using primary search or secondary search correspondingly to option Use 2nd search:

  • Enter — Search and Replace downwards. (Replace dialog part only)
  • Ctrl+Enter — Search and Replace upwards. (Replace dialog part only)
  • Shift+Enter — Search downwards from the beginning of the document.
  • Ctrl+Shift+Enter — Search upwards from the end of the document.

Using primary search directly. Note: All these hotkeys automatically turn the Use 2nd search option off:

  • F3 — Search downwards.
  • Ctrl+F3 — Search upwards.
  • Shift+F3 — Search downwards, select text along.
  • Ctrl+Shift+F3 — Search upwards, select text along.

Using secondary search directly. Note: All these hotkeys automatically turn the Use 2nd search option on:

  • F2 — Search downwards.
  • Ctrl+F2 — Search upwards.
  • Shift+F2 — Search downwards, select text along.
  • Ctrl+Shift+F2 — Search upwards, select text along.

Last Tool.. (Ctrl+T)

Shows the Search and Last Tool dialog at the bottom of the window, which is an extension to the Search dialog, also called the Search bar. After entering search conditions, searches for specified Find phrase within the document and invokes the Last Tool command on found occurrence.

Last Tool button first verifies that the current selection matches the given search conditions, then invokes the Last Tool command, or if current selection does not match the search, searches for the next occurrence instead. This behaviour ensures that only matching pieces ever get modified. After successful invocation, automatically searches for any next occurrence.

Last Tool All button starts searching at the beginning of the document and invokes the Last Tool command on every match found throughout the entire document. Note: Since searching and processing throughout the entire document can take a very long time, Esc can be used to interrupt the process at any time.

Note: Works with the primary search definition, unless Use 2nd search option specifies otherwise.

Note: See Find command for full list of hotkeys available in the Search dialog (and Search and Last Tool dialog as well).

Look for.. (Ctrl+U)

Shows the Search dialog with the Use 2nd search option turned on. If re-using phrase and options from previous search, uses secondary search phrase and options.

See Find command for more details about the Search dialog.

Look for Next (F2)

Searches for the next occurrence of the recently specified search within the document. If no search was specified yet, shows the Search dialog.

Note: Works with the secondary search definition.

Look for Previous (Ctrl+F2)

Searches for the previous occurrence of the recently specified search within the document. If no search was specified yet, shows the Search dialog.

Note: Works with the secondary search definition.

Look for Selected (Alt+F2)

Sets the search, then searches for the next occurrence, using Look for Next.

Sets Find to content of the selection, turns off Match case, Whole words and RegExps options, and selects Escapes option if it is required by the nature of the selection content.

Note: Works with the secondary search definition.

Tip: There are no restrictions on what the selection may or may not contain. You can select text over multiple lines and start a search for multi-line phrase.

Look for Later (Alt+Ctrl+U)

Sets the search like Look for Selected, but does not search for the occurrence.

Sets Find to content of the selection, turns off Match case, Whole words and RegExps options, and selects Escapes option if it is required by the nature of the selection content.

Note: Works with the secondary search definition.

Tip: There are no restrictions on what the selection may or may not contain. You can select text over multiple lines and start a search for multi-line phrase.

Select to Next (Shift+F2)

Searches for the next occurrence of the recently specified search, using Look for Next. If successful, extends the current selection to cover the found match.

Note: Works with the secondary search definition.

Select to Previous (Ctrl+Shift+F2)

Searches for the previous occurrence of the recently specified search, using Look for Previous. If successful, extends the current selection to cover the found match.

Note: Works with the secondary search definition.

Personal tools