主页  »  技术支持  »  指南/使用技巧  »  UltraEdit  »  Multiline find and replace
IDM Power Tips

Multiline find and replace

A powerful feature of UltraEdit and UEStudio is their wide range of find/replace features. You can find a string of text in a file, in multiple files, all open files, project files, throughout a directory and its sub-directories, and more. Not only can you perform a find but also a replace. Oh, and did we mention it supports regular expressions? But that's another subject... (learn about regular expressions)

What happens if the text you need to find/replace spans multiple lines? No problem... You've come to the right place.

Multi-Line Find and Replace


Step 1: Variables

For a multi-line Find/Replace you can use "^p" as the CR/LF (line terminator) as it is translated to a hard return.

You can also use the contents of the clipboard or selected text in a search or replace string with "^c" and "^s" respectively.

UltraEdit and UEStudio support the following variables in the Find/Replace dialogs:

Symbol Function
^^ searches for a "^" character
^s searches for selected (highlighted) text when a macro is running
^c searches for the contents of the clipboard when a macro is running
^b matches a page break
^p matches a newline (CR/LF) (paragraph) (DOS Files)
^r matches a newline (CR Only) (paragraph) (MAC Files)
^n matches a newline (LF Only) (paragraph) (UNIX Files)
^t matches a tab character

Additional information regarding Find/Replace and Find/Replace in Files is available in the Help File.


Step 2: Perform the Replace

For this example, we are going to use "^s" and "^c" for our Replace. We are going to replace the text that is selected, in the edit window, and replace it with the contents of the clipboard.

Select the text you would like to use as your "Replace With" text and copy it to the clipboard. We have selected and copied the highlighted text below.

Multi-Line Find and Replace

Select the text which you would like replaced.

Multi-Line Find and Replace

Open the Replace dialog from the Search menu. You should see that the selected text has populated the "Find What" field. You can leave this here rather than using the ^s, however for this example we are using the variables.

Type "^s" and "^c" in the appropriate Find What and Replace With fields.

Multi-Line Find and Replace

Click on Replace All and you should see your "Find What" (selected text) replaced with your "Replace With" (clipboard text).

Multi-Line Find and Replace


Back to power tips index


Buy Now
Upgrade
Download

应用导航

UltraEdit feature maps
全新功能

Cnet/Download.com review of UltraEdit
"我们并没有夸大其词:
UltraEdit真的非常棒..."

节省将近50%

IDM Software Bundles

在UltraEdit基础上绑定其它的产品许可节省将近50%

旅行, 任何人?

UE3 software

UE3和您的UltraEdit捆绑一起升级,节省将近50%或者更多!


Take the UltraEdit tour