#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?
Find next line with spaces in positions 1-5, and blank lines
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
#1
#2Find what: ^----- [Replace the hyphens with spaces]
[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: ^$
[X] Regular expression
Find what: ^\n
[X] Regular expression