Page 1 of 1

Regex and block select mode

Posted: Thu Jan 31, 2002 2:24 pm
by Todd DeZwaan
I am using the block select mode to select and remove all of the carriage returns in a block. I tried to replace them using the regex \n and keeping the replace space blank, but I get a message "Cannot find regular expression '\n'". I have the Regular expression checked in the replace window. I have also tried the join lines tool but that joins all of the lines spanned by the block, not just the selected carriage returns.

Is there a way to get the \n regex recognized in block select mode?

Todd

Re: Regex and block select mode

Posted: Mon Feb 11, 2002 2:38 pm
by Carlyle Sutphen
Hi, Todd.

That's not working because block mode basically only sees spaces where the block extends beyond the end of the line.

It looks like you want to join lines shorter than a certain length to it's following line.

In the case that the maximum line length you want to join to it's follower is 14, you could

find: ^(.{1,14})\n
and
replace: \1

Carlyle

Re: Regex and block select mode

Posted: Mon Feb 11, 2002 2:54 pm
by Roy Beatty
Unless you're using POSIX-optioned regex, he meant to say:

find: ^\(.\{1,14\}\)\n<br>
and<br>
replace: \1

Re: Regex and block select mode

Posted: Mon Feb 11, 2002 3:35 pm
by Carlyle Sutphen
I forgot that I had turned on that option :-)