Find and replace text in CotEditor on Mac

CotEditor has a powerful find and replacement feature that also can use regular expressions.

Open the Find window

  1. In the CotEditor app on your Mac, open a document.

  2. Choose Find > Find.

Screenshot of the Find window

Enter find and replace conditions

Find/replacement fields

Enter the text to find to the find field, the field with a lope icon.

To replace matched text, enter the text to replace with to the replacement field, the field with a pen icon in addition to the search text. When the replacement field is empty by replacement, the matched text is just removed.

To insert the following special characters to the fields, use the following key combinations:

CharacterKey combination
line ending character Option-Return
tab character Option-Tab

Find/replacement histories

You can reuse previous find and replacement text by selecting them from the lope/pen icon in the field.

Find options

OptionDescription
Regular Expression

Search with regular expressions.

Ignore Case

Ignore character case on search.

In Selection

Search text only from selection.

Change advanced find options

You can customize the find behavior in the advanced find options view. To open the view, click the ellipsis button in the Find window.

OptionDescription
Wrap search around

Find from the the beginning of the document if there is no match after the insertion point.

Search incrementally

Search document as you type in the search field.

Textual search

Options for search when the regular expression option is turned off.

OptionDescriptionDefault
Match only whole words

Restrict search results to whole words.

Off
Distinguish characters strictly

Exact character-by-character equivalence.

Off
Ignore diacritical marks

Search ignores diacritical marks (for example, ö = o).

Off
Ignore width differences

Search ignores width differences in character forms (for example, a = a).

Off

Regular expression search

Options for search when the regular expression is selected.

OptionDescriptionDefault
Dot matches line separators

Allow period to match any character, including newline characters (singleline).

Off
Anchors match lines

Allow ^ and $ to match the start and end of lines (multiline).

On
Use Unicode word boundaries

Use Unicode TR#29 to specify word boundaries

Off
Unescape replacement text

Unescape metacharacters with backslash in the replacement text.

On

Highlight search results

With the Find All and Highlight All commands, all the places in the document that match your search criteria can be highlighted. When searching using regular expressions, each captured group is highlighted in a different color.

To remove the highlight, choose Find > Remove Highlights.

See also