3

I can easily find '\n' in notepad++, but my problem here is that I have to find '\n' when not followed by a specific character ("#" in this case). So do I use Regex with '\n'? Is it possible?

Example :

Stuff to ignore
#Like that

Stuff
To change
Amelia
  • 2,967
  • 2
  • 24
  • 39
bAN
  • 13,375
  • 16
  • 60
  • 93

2 Answers2

6

Try lookahead assersion:

\n(?!#)
xdazz
  • 158,678
  • 38
  • 247
  • 274
2

You can find some specifics in this question, but first make sure your line-endings are purely \n.

Mac OS line-endings are \r (OSX is \n), Windows/DOS are \r\n,and UNIX-style are \n, mostly.

The regex you are looking for is probably .*\n[^#].*, specifying [^...] (not set)

But you could try using the EOL regex character, $, instead:
.*$[^#].*

Or, as xdazz said, just try \n(?!#)

Community
  • 1
  • 1
Amelia
  • 2,967
  • 2
  • 24
  • 39