regex - How to match lines not ending (-1)\r\n -


i'm trying match first 5 lines, , last line, in sample:

-- 2012-09-20 rep +6    = 184         1  12532070 (2)  2  12531806 (5)  2  12531806 (5) -- 2012-09-21 rep +12   = 196         3  125xxxxx (-1)  3  125xxxxx (-1)  16 12557052 (2) 

leaving following unmatched:

 3  125xxxxx (-1)  3  125xxxxx (-1) 

i've tried following regular expressions:

^.*[^(-1)\r\n].* ^.*[^(-1)].*\r\n ^.*[^\(-1\)\r\n].* ^.*[^\(\-1\)\r\n].* ^.*[?!\(-1)\r\n].* ^(!?.*-1.*\r\n) 

but none of them want (mostly matching all lines).

my regex skills not brilliant - can point me in right direction?

you can use negative lookahead

^(?!.*\(-1\)$).*$\r\n 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

How to call a javascript function after the page loads with a chrome extension? -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -