https://npp-user-manual.org/docs/searching/ 

Find..... Assertions

These special groups consume no characters. Their successful matching counts, but when they are done, matching starts over where it left.



    (?=pattern) ⇒ positive lookahead: If pattern matches, backtrack to start of pattern. This allows using logical AND for combining regexes.

        The expression (?=.*[[:lower:]])(?=.*[[:upper:]]).{6,} tries finding a lowercase letter anywhere. On success it backtracks and searches for an uppercase letter. On yet another success, it checks whether the subject has at least 6 characters.

        q(?=u)i doesn’t match quit, because the assertion (?=u) matches the u but does not consume the u, as matching u consumes zero characters, so then trying to match i in the pattern fails, because it is still comparing against the u in the text being searched.

    (?!pattern) ⇒ negative lookahead: Matches if lookahead pattern didn’t match.

    (?<=pattern) ⇒ positive lookbehind: This assertion matches if pattern matches immediately before the current position in the search.

    (?<!pattern) ⇒ negative lookbehind: This assertion matches if pattern does not match immediately before the current position in the search.
        NOTE: In the lookbehind assertions, pattern has to be of fixed length, so that the regex engine knows where to test the assertion. Similar constructs for variable-length lookbehind include:
            For variable-length lookbehind assertions from a limited set of constant data items, a construct such as ((?<=short)|(?<=longer)) is viable. The individual lookbehinds still cannot include + or * or similar variable-length syntax.
            If your desired lookbehind is more complicated than that, you can use \K (see above): instead of (?<=a.*b)MATCH, which won’t work, use a.*b\KMATCH. The \K workaround will only work if the desired lookbehind is the first part of your match, because everything before the \K is excluded from the final match.





https://stackoverflow.com/questions/52015162/i-need-to-search-in-notepad-for-lines-not-ending-with 

Replace using a lookbehind in regex mode:

Find:

(?<!,)$

Replace:

, [just a single comma]

