Question

I have list of lines structured like this

c:\names1\ex1
c:\names2\ex2
c:\names3\ex14
http://example1
http://example3
c:\names4\ex15
http://example4
c:\names4\ex17
c:\names4\ex18

I want to use Regex to mark all lines which followed by c:\ as a start of line not http, In this case the first two lines and the last two lines should be marked. Because the others "lines started with c: too" followed by http:\ as a start of line

Was it helpful?

Solution

There is an easy way to perform this.

  1. Go to Search > Find... > Select the Mark Tab. Make sure you have Regular expression checked under the Search Mode box and make sure you check the Bookmark Line box.

  2. You want to search for the following, still being under the Mark tab.

    Find what: ^c:\S++(?!\r?\nhttp)
    
  3. Finally, click Mark All which bookmarks those lines.

enter image description here

OTHER TIPS

You can use this pattern:

^c:.*+(?!\r?\nhttp:)

pattern details:

^                # anchor for the start of the line
c:      
.*+              # zero or more characters until the end of line (possessive)
(?!\r?\nhttp:)   # not followed by a newline and http:
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top