I need a notepad++ regex that bookmark last non-empty line that placed before a specific line.
for example if my list is this:
Word1
Word 2
Word 3$
Word45
fghjyh
Q1
/////////////////////////
Commando1
Commando 43
Doctor##
44GGTT45
TTTTTT
QQQWW22
/////////////////////////
regex must bookmark following lines:
Q1
QQQWW22
I tried following regex but not working:
^.+\S.+(?=^/{23}/)
how to fix this? where is my regex problem?
>Solution :
You can use
^\h*\S.*(?=\R+/{24})
Details:
^– start of a line\h*– zero or more horizonatal whitespaces\S– a non-whitespace char.*– the rest of the line(?=\R+/{24})– immediately to the right of the current location, there must be one or more line breaks (\R+) and then 24 slashes.
See the regex demo.
Screenshot:
