Lesson 7: Using Find and Replace
Find And Replace Excel Mac Shortcut
/en/word2016/formatting-text/content/
Introduction
When you're working with longer documents, it can be difficult and time consuming to locate a specific word or phrase. Word can automatically search your document using the Find feature, and it allows you to quickly change words or phrases using Replace.
Optional: Download our practice document.
Watch the video below to learn more about using Find and Replace.
To find text
Use the Find feature to find the misspelled word and Replace it with Fundraising. Use the Find feature to find out in which month elections were held. Hint: Search for the word elections. Let's say the original Fundraising Chair has resigned and been replaced. Use Find and Replace All to change Julia Stevens to Belinda Haygood. FAQ – Find & Replace How can I search for a word in the text? You can use the translation editor’s search tool, just click on the magnifying glass icon in the upper right corner or use the shortcut CTRL+F for Windows or CMD+F for Mac to bring up the search and replace panel. What can I search for?
In our example, we've written an academic paper and will use the Find command to locate all instances of a particular word.
- From the Home tab, click the Find command. Alternatively, you can press Ctrl+F on your keyboard.
- The navigation pane will appear on the left side of the screen.
- Type the text you want to find in the field at the top of the navigation pane. In our example, we'll type the word we're looking for.
- If the text is found in the document, it will be highlighted in yellow and a preview of the results will appear in the navigation pane. Alternatively, you can click one of the results below the arrows to jump to it.
When you are finished, click the X to close the navigation pane. The highlight will disappear.
For more search options, click the drop-down arrow next to the search field.
- Paste Plain Text: This AppleScript enables Word to paste text that adopts the style of surrounding characters, via a single menu command or a keyboard shortcut. I wanted a way to do this in Word.
- How to use sed to match word and perform find and replace. In this example only find word ‘love’ and replace it with ‘sick’ if line content a specific string such as FOO: sed -i -e '/FOO/s/love/sick/' input.txt Use cat command to verify new changes: cat input.txt. Recap: Using sed to find and replace. The general syntax is: ## find.
Find previous (while in the Find window) Shift-Command-G. Place the selected text in the Find & Replace text field. Scroll the window to show the selected text or object. Hide the Find window. Look up the word at the insertion point. Display a list of words to complete the.
To replace text
At times, you may discover that you've made a mistake repeatedly throughout your document—such as misspelling a person's name—or that you need to exchange a particular word or phrase for another. You can use Word's Find and Replace feature to quickly make revisions. In our example, we'll use Find and Replace to change the title of a magazine so it is abbreviated.
- From the Home tab, click the Replace command. Alternatively, you can press Ctrl+H on your keyboard.
- The Find and Replace dialog box will appear.
- Type the text you want to find in the Find what: field.
- Type the text you want to replace it with in the Replace with: field. Then click Find Next.
- Word will find the first instance of the text and highlight it in gray.
- Review the text to make sure you want to replace it. In our example, the text is part of the title of the paper and does not need to be replaced. We'll click Find Next again to jump to the next instance.
- If you want to replace it, you can click Replace to change individual instances of text. Alternatively, you can click Replace All to replace every instance of the text throughout the document.
The text will be replaced.
When you're done, click Close or Cancel to close the dialog box.
For more search options, click More in the Find and Replace dialog box. From here, you can select additional search options, such as matching case and ignoring punctuation.
When it comes to using Replace All, it's important to remember that it could find matches you didn't anticipate and that you might not actually want to change. You should only use this option if you're absolutely sure it won't replace anything you didn't intend it to.
Challenge!
- Open our practice document.
- Using the Find feature, determine which pages mention Caroline Gordon.
- The name T.S. Eliot is misspelled. Replace all instances of Elliot with Eliot. When you're finished, you should have made three replacements.
- Allen Tate's name is also misspelled. Find and Replace Alan with Allen. Hint: Do not use Replace All. Otherwise, you might accidentally replace the word balance.
/en/word2016/indents-and-tabs/content/
Sublime Text featurestwo main types of search:
Both support regular expressions,a powerful tool for searching and replacing text.
# Single File
# Searching
Keyboard shortcuts related to the search panel:
Description | Shortcut |
---|---|
Open search panel | CtrlF |
Toggle regular expressions | AltR |
Toggle case sensitivity | AltC |
Toggle exact match | AltW |
Find next | ⏎ |
Find previous | ⇧⏎ |
Find all | Alt⏎ |
# Incremental Search
Keyboard shortcuts related to the incremental search panel:
Description | Shortcut |
---|---|
Open incremental search panel | CtrlI |
Toggle regular expressions | AltR |
Toggle case sensitivity | AltC |
Toggle exact match | AltW |
Find next | ⏎ |
Find previous | ⇧⏎ |
Find all | Alt⏎ |
The only difference between this paneland the regular search panellies in the behavior of the ⏎ key.In incremental searches,it will select the next match in the fileand dismiss the search panel for you.Choosing between this panel or the regular search panelis a matter of preference.
# Replacing Text
Keyboard shortcuts related to the replace panel:
Description | Shortcut |
---|---|
Open replace panel | CtrlH |
Replace next | Ctrl⇧H |
Replace all | CtrlAlt⏎ |
# Tips
# Other Ways of Searching in Files
Goto Anythingprovides the #
operatorto search in the filtered file.
# Other Search-Related Key Bindings
These key bindings workwhen the search panel is hidden:
Description | Shortcut |
---|---|
Search forward using most recent pattern | F3 |
Search backwards using most recent pattern | ⇧F3 |
Select all matches using most recent pattern | AltF3 |
You can also perform searchesbased on the current selection:
Description | Shortcut |
---|---|
Search using current selection | CtrlE |
Replace using current selection | Ctrl⇧E |
# Multiline Search
You can type in multiline search patternsinto search panels.To enter newline characters,press Ctrl⏎.
Note that search panels are resizable too.
# Multiple Files
# Searching
Keyboard shortcuts related to Find in Files:
Description | Shortcut |
---|---|
Open Find in Files | Ctrl⇧F |
Toggle regular expressions | AltR |
Toggle case sensitivity | AltC |
Toggle exact matches | AltW |
Find next | Enter |
# Search Scope
The Where field in Find in Fileslimits the search scope.You can define scopes in several ways:
- Adding individual directories (Unix-style paths, even on Windows)
- Adding/excluding files based on wildcards
- Adding symbolic locations (
<open folders>
,<open files>
...)
It is also possible to combine these filters using commas; for example:
Press the ... button in the search panelto display a menu containing scope options.
# Results Format
In the search panel, you can customizehow results are displayed.These are the available options:
- Show in separate view
- Show context
# Navigating Results
If the search yields matches,you can move through the sequenceusing the following key bindings:
Description | Shortcut |
---|---|
Next match | F4 |
Previous match | ⇧F4 |
Open match | ⏎ |
Mac Shortcut Find And Replace
You can also double-clickon lines with a match.
# Regular Expressions
Regular Expressions find complex patterns in text.To take full advantageof the search and replace facilities in Sublime Text,you should at least learnthe basics of regular expressions.In this guidewe won't explain how to use regular expressions.
The term regular expressionis usually shortened to regexp or regex.
This is how a regex might look:
To use regular expressions in Sublime Text,you first need to activate them inthe various search panels.Otherwise, search terms will be interpreted literally.
Sublime Text uses thePerl Compatible Regular Expressions (PCRE) enginefrom the Boost library.
See Also
- Boost library documentation for regular expressions(opens new window)
- Documentation on regular expressions.
- Boost library documentation for format strings(opens new window)
- Documentation on format strings.Note that Sublime Text additionally interprets
{n}
as${n}
.