Finding and Replacing Text

Searching for and replacing passage text is done through the Find and Replace dialog, which you can open by choosing Find and Replace from the Story top toolbar tab.

When you enter text into the Find text field, Twine will highlight the cards of passages containing that text. You'll also see a numeric count of matching passages in the corner of the Find and Replace dialog.

To replace text you're searching for, enter the replacement in the Replace field and select Replace In All Passages.

Focusing Searches

The Include Passage Names checkbox controls both whether text matches are highlighted for passage names, and whether text replacements are done in passage names.

The Match Case checkbox controls whether text matches are case-sensitive. When it's on, text must be the exact case of what you enter in the Find field for it to be considered a match.

The Use Regular Expressions checkbox controls whether Twine uses the JavaScript regular expression parser to both find and replace text. Regular expressions are a way to specify text patterns. For example, the regular expression .and matches both 'hand' and 'band'.

Regular expressions have a detailed syntax all their own. Mozilla Developer Network has a good introduction to the topic.

If you use regular expressions in your search, the Replace field can also contain backreferences. For example, if you enter (.)and in the Find field and $1--- in the Replace field, the text Sand band will be replaced to S--- b---.