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

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
agent86
Posts: 18
Joined: Wed Apr 26, 2006 2:59 am
Location: SF Bay Area

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

Post 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?
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post 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
agent86
Posts: 18
Joined: Wed Apr 26, 2006 2:59 am
Location: SF Bay Area

Thank you...

Post by agent86 »

...
Post Reply