Demos
Browse all demos

Find and Replace

Search the document, match case or whole words, use regular expressions, and replace one match or all of them.

  • The find toolbar button, Ctrl+F (Cmd+F) inside the editor, and editor.openFindDialog() all open the same panel.
  • Options: match case, whole word and regular expressions. The panel counts the matches, and Next / Previous select them one at a time.
  • Replacing keeps the formatting of the text it replaces, and Replace All is a single undo step.
<div id="div_editor1"></div>
<button onclick="editor1.openFindDialog()">Find and replace</button>
<script>
    var config = {};
    config.toolbar = "mytoolbar";
    config.toolbar_mytoolbar = "{bold,italic,underline}|{find}|{undo,redo}";

    var editor1 = new RichTextEditor("#div_editor1", config);
    // Ctrl+F (Cmd+F on a Mac) opens the same panel from inside the editor.
</script>