1

I have a list that goes a something like this pattern.

abc
q
w
e
xyz
abc
a
s
d
abc
z
x
c

Now, what I want to do is, I want to copy the section from xyz covering asd but not zxc. I have a regex that goes

xyz(.*?)(abc)(.*?)(abc)

That marks the lines fine (it also takes an abc, but I can fix that later), but then what? I try to bookmark it, it only bookmarks xyz, I can't bookmark all the found lines. Trying to catch the part I don't want to delete it is useless, the XYZ lines get caught in this as well, because of the way it is set up.

The text is marked with pink when I try the bookmark thing in search, but there doesn't seem to be a way to do anything with this, other than admire how notepad++ dutifully found everything I wanted.

halfer
  • 19,824
  • 17
  • 99
  • 186
LKJAndersen
  • 27
  • 1
  • 4

3 Answers3

1

After some testing with Notepad++. At least with the version I have v6.6.8 I am pretty sure what you are trying to do is not possible because as you said, it will only mark the first line of the match.

But if what you are trying to do is get a list of all the lines matched you can use another tool to get it done.

Findstr could do the job in Windows but I don't think it has the ability to make . matches new lines so it won't fit your regex.

You can do it with Perl like here: Print all matches of a regular expression from the command line?

You can use grepWin or GNU grep as suggested here: What are good grep tools for Windows?

Community
  • 1
  • 1
Oscar Hermosilla
  • 480
  • 5
  • 21
0

Does the "Find All in Current Document" button in the Find dialog work for this?

Tim
  • 126
  • 1
  • 5
0

If you're in Notepad++ v6 or higher, you'll get a

. matches newline

checkbox next to the regular expression option, this should do what you want.

enter image description here

Jordan Robinson
  • 855
  • 11
  • 25
  • No, I already did that, I can find the lines just fine, I just can't mark them to copy. – LKJAndersen Aug 31 '14 at 20:44
  • 1
    Oh, I'm sorry, I must have missed that somehow. What do you mean when you say you try to bookmark it exactly? I don't think I'm familiar with that functionality. – Jordan Robinson Aug 31 '14 at 20:49
  • In Mark, in the search-thing, you mark "mark line", or something, and it puts a little blue dot you use to find that line. – LKJAndersen Aug 31 '14 at 21:27