Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am looking for text editor for Windows which is capable of performing search and replace operation of multi-line text block.

It should be able to run this operation on a folder or currently opened files.

Ideally it supports regular expressions, but it's not essential.

Thanks!

share|improve this question
add comment

6 Answers 6

up vote 6 down vote accepted

I used Notepad++ for a while when I still had to do stuff on a Windows computer; it's got decent support for regular expressions. It's got an intuitive interface, and you won't have to memorize key combinations and shortcuts.

share|improve this answer
    
Tried notepad, works fine, only small issue is that multi-line text is not displayed correctly in little text area dedicated for search sentence. (weird characters where tab and \r\n should be). Otherwise loving it! Especially search results grouping. –  Art Oct 5 '09 at 3:46
    
Hmm it's been a while since I used it, but I think there are options for how newlines, carriage returns, and tabs look. You might want to play around with the settings a bit. I used to switch between visible symbols for those and a more conventional appearance depending on what I was doing. –  Shane Oct 5 '09 at 23:47
add comment

Not an text editor, but you should give TextCrawler a shot. It is very lightweight and powerful tool to perform search and replace in files. A simple and good UI to put multiline text.

It allows Standard Search, Regular Expression, Fuzzy Search and Batch Commands.

share|improve this answer
add comment

EditPadPro for the win! It does everything you asked for:

  1. Multi-line search and replace
  2. Replace over all open files
  3. Regex support

Actually I think the free version does all of that too.

It is seriously the best text editor I have ever used. It has all the features you might need. I typically find it goes beyond the call of duty.

share|improve this answer
add comment

When I need multi-line search-replace I use Microsoft Word. I never use Microsoft Word as a text editor except when I need this feature. You can use ^p to search for linebreaks.

Typically I do this:

I edit a text file in my favorite text editor, but I need multi-line search-replace
Ctrl-A, Ctrl-C to select and copy all text editor
Start Microsoft Word
Ctrl-V
Search/Replace "First line^pSecond line" with "New first line^pNew second line"
Ctrl-A, Ctrl-C to select and copy all from Word
Switch back to text editor
Ctrl-V to paste newly fixed-up text
Continue editing document in my favorite editor

This works for me.

share|improve this answer
add comment

emacs

Use C-q C-j to specify a newline in the pattern to match or replace with. Plain text and regexp are supported, either all at once or in query mode (get confirmation for each match).

The functions you want are

replace-string
query-replace-string
replace-regexp
query-replace-regexp

and they can all be invoked with M-x <function name>. Some have default bindings.

Use C-h f <function-name> to learn what binding is currently assigned to any function.

To select a block from the text to use

  1. More the point to one end of the block. Hit C-<space>.
  2. Move the point to the other end. Hit C-w which will yank the whole block then C-y to return the yanked block or invoke copy-region-as-kill.
  3. M-x <function> then C-y to paste the block into the search space. Newlines are handled naturally.
  4. proceed as normal.
share|improve this answer
    
You can also select a block of text by highlighting it with a mouse. I know this sounds obvious, but some people do not know Emacs is a GUI application. –  Richard Hoskins Oct 5 '09 at 6:21
add comment

Vim

Blocks are selected with v, Ctrl-V, or Shift-V (among other ways). Once selected, substitute commands are run against the block by default.

share|improve this answer
    
Can you search for selected block in opened files in vim? –  Art Oct 4 '09 at 23:38
    
@Art yes, but i've no idea how offhand. –  quack quixote Oct 5 '09 at 0:02
    
I don't understand the question. –  wfaulk Oct 5 '09 at 1:17
    
Basically, I select block of text with "V", and then I want to search for selected text (not within it) in given file/folder. Can vim do that? –  Art Oct 5 '09 at 2:41
    
@Art - you wish to find a selected block of text within files in a folder, right ? Not within, but vim relies on several tools for that sort of thing (grep and the like), so start off that, and see what you need. –  ldigas Oct 5 '09 at 2:54
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.