Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to do a regular expression search and replace in Textpad where the search term spans multiple lines.

e.g. document contains:


I would like to replace everything between "Hello" and "World" with a space.

I have tried searching for the regular expression:


but this does not match (I assume due to the text spanning across multiple lines).

share|improve this question
up vote 0 down vote accepted

Since Textpad seems to have only very limited regex support, I only got it done with three replaces:

  1. Replace each newline (\n or \r\n) in your text with a unique pattern, e.g. ##NEWLINE##

  2. Use the regex (Hello).*(World) and replace the match with \1 \2
    (you can also just use Hello.*World and replace with Hello World)

  3. Finally, revert step 1 by replacing all ##NEWLINE## with the actual newline

I suggest taking a look on Notepad++ which has better regex support, a lot of other features (especially for source code editing), and is open source / free software.

share|improve this answer

Your Answer


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.