Page 1 of 1

Find next line with spaces in positions 1-5, and blank lines

Posted: Thu Jun 07, 2007 7:15 am
by agent86
#1. How can I search and find the next line that has 5 spaces at the beginning of the line.

#2. How do I find the next blank line?

Posted: Thu Jun 07, 2007 9:24 am
by ben_josephs
#1
Find what: ^----- [Replace the hyphens with spaces]

[X] Regular expression
#2
Find what: ^$

[X] Regular expression
#2 matches zero characters between the beginning of a line (^) and the end of a line ($). Therefore, after it has matched, the cursor is positioned at a point that is both the beginning and end of an empty line. So, if you repeat the search, it matches again where it is and the cursor doesn't move. If you want to be able to repeat this match without explicitly moving the cursor, you have to ensure that the cursor moves each time a match is found. The following version includes the newline at the end of the line in the match, so that the cursor advances to the next line when it matches, and the previous match can't be repeated:
Find what: ^\n

[X] Regular expression

Thank you...

Posted: Thu Jun 07, 2007 3:33 pm
by agent86
...