WonderPen Help

Find and replace

During the writing process, press the shortcut key Ctrl + F ( + F for macOS) to open the Find and Replace panel.

The search function has two models, Floating Search and Embedded Search. You can switch between the two models according to your needs and habits.

The figure below shows Floating Search. This model is a floating window, which can display documents matching the search keywords in the entire document library, which is convenient for searching and replacing in the entire document library (or selected documents).

To switch from floating search to embedded search, just click the down arrow icon in the upper right corner of the window.

The figure below shows embedded search. This form of search interface will be displayed below the editor. After entering keywords, the keywords in the current document will be highlighted directly, which is convenient for searching and replacing in the current document.

To switch from embedded search to floating search, just click the up arrow icon in the top right corner of the component.

Floating Search

After entering keywords in the search panel, WonderPen will automatically search for matching text, as shown in the following figure:

You can replace the results item by item, or replace all at once.

Search Scope

The floating search can specify the search scope, by default, the scope of search and replacement is the document currently being edited, you can also select other scopes as needed, as shown in the following figure:

On the right side, you can quickly switch the scope between All Documents and Current Document:

Embedded Search

You can switch to the embedded search by clicking the down arrow icon in the upper right corner of the floating search window, as shown below:

Embedded search differs from floating search in the following ways:

  • Embedded search can directly highlight the matching keywords in the current document, which is convenient for searching and replacing the current document
  • Embedded search filters the directory tree in the left panel to only show documents (or subdocuments) matching keywords

Regular Expression

The search box also supports regular expressions:

Regular Expression

Regular expressions are very powerful. For example, enter m.*?y to search for any string starts with m and ends with y, such as monkey, money and mxxxxy, etc. The highlighted text in the figure below is matching results for m.*?y:

Regular expression match

The regular syntax supported by WonderPen is the same as the regular syntax in JavaScript. Here are some examples:

  • a.*?b: Find the shortest sentence that starts with a, ends with b, and has no line break in between
  • \d+:find a string of numbers
  • \[\d+]:Find a string of numbers enclosed in square brackets like [276]
  • ^\s+:Find whitespace characters at the beginning of a line

Regular expressions are very powerful, if you want to learn more about it, you can visit related tutorials or documentation, or test your expressions on websites such as regex101.