Using placeholders in find and replace

Coda's find and replace has a unique feature called "placeholders". A placeholder matches any arbitrary piece of text, and can be substituted back into the replacement text at any position.

Using placeholders to find

To insert a placeholder into the Find box, click the placeholder (blue star). Placeholders are numbered (1-9) in the order they occur in the find text. You can drag the placeholder to a different position in the text, if desired.

As an example, performing a find for <title>①</title> will match any text enclosed in a title tag.

Using placeholders to replace

Inserting placeholders into the replace box allows you to substitute the text matched by the find placeholder with the same number.

Continuing the above example, performing a replace with <body>①</body> will turn the title tag into a body tag without disturbing its contents.

Placeholders cannot be used if the Use Regular Expressions find option is enabled. If regular expressions are in use, placeholders will be converted into an equivalent regular expression.