Welcome!

ColdFusion Authors: Greg Ness, Liz McMillan, Pat Romanski, Andreas Grabner, David Strom

: Article

Using Extended Find and Replace in Studio

Using Extended Find and Replace in Studio

Ever had to find all the references to a given string among all the files in your application? And how about in all the files in any of several subdirectories, perhaps in your web root? Even more challenging, have you wanted to change occurrences of a string in such a large number of files? Studio's Extended Find and Extended Replace commands are just the ticket.

Available in Studio from the Search command on the menu bar, or the shortcuts Ctrl-Shift-F and Ctrl-Shift-R, the commands are a real timesaver.

Among the many features of the commands are that you can:

  • run either command against the current document, all open documents, any folders (and their subfolders, optionally), or a project — which means you can indeed search against RDS file directories, by setting them up as a project
  • selectively save and reuse entries (Click the arrow button next to the Find what box)
  • restrict execution to files with specified extensions
  • enforce case-sensitive searches (via a checkbox)
  • use regular expressions to search (via a checkbox)
  • choose to search page content only, excluding the tags themselves (via a checkbox)
  • choose to backup files before making replacements at the folder or project level (via a checkbox)

A Results pane displays a list of locations where the matched string was found/replaced. You can double-click on a match in the list to highlight it in the document. Right-click in the Results pane to clear the pane or close it.

Keep the following in mind:

  • the Extended Replace command skips read-only files

  • you may find it helpful to use the Alt-W shortcut to move to the "Find Where" portion of the dialogue, and the Alt-P shortcut to move from the "find what" prompt to the "replace with" prompt when doing a replace

  • as with most Find dialogues, if you highlight text in the editor before calling up the command, that text will be filled in automatically for the "find what" prompt see chapter 12 in Using CF Studio

See Studio's Help tab (or the Help command on the command menu) for more information — all the Allaire documentation is there. It's in Chapter 12 in 4.5 and Chapter 6 in 4.01.

More Stories By Charlie Arehart

A veteran ColdFusion developer since 1997, Charlie Arehart is a long-time contributor to the community and a recognized Adobe Community Expert. He's a certified Advanced CF Developer and Instructor for CF 4/5/6/7 and served as tech editor of CFDJ until 2003. Now an independent contractor (carehart.org) living in Alpharetta, GA, Charlie provides high-level troubleshooting/tuning assistance and training/mentoring for CF teams. He helps run the Online ColdFusion Meetup (coldfusionmeetup.com, an online CF user group), is a contributor to the CF8 WACK books by Ben Forta, and is frequently invited to speak at developer conferences and user groups worldwide.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.