Page 1 of 1

commenting an entire block with !-----

Posted: Fri Nov 19, 2010 3:36 pm
by weschrist
Hi,

I have the following text:

asdf
asdf
asdf

I would like to highlight say the first 2 lines, push CTRL+K, and make it look like this:

!-----asdf
!-----asdf
asdf

Somehow I created a macro to do this a few months ago, recently reinstalled Textpad, and now I can't figure it out.

My closest attempts end in either the !----- overwriting the highlighted text or only the first line is highlighted.

Thanks

Posted: Sun Nov 21, 2010 6:08 pm
by weschrist
Nothing????

Posted: Sun Nov 21, 2010 10:10 pm
by ben_josephs
You don't need a macro to do that. Use Search | Replace... (<F8>):
Find what: ^
Replace with: !-----

[X] Regular expression

Replace All

Posted: Fri Jan 07, 2011 5:43 am
by weschrist
Thanks Ben. Now I can just make that sequence a macro with a shortcut key.