Cisco regex match this but not that

Viewed 1001

I have the following string in a much larger config:

as-path-set DAVE-9999-CBG
as-path-set DAVE-9999-CBG
as-path-set DAVE-55555-CBG
as-path-set DAVE-44444-CBG
as-path-set DAVE-33333-CBG
as-path-set DAVE-11111-CBG
as-path-set DAVE-22222-CBG

I would like to match all of these lines except for the lines that contain 9999. I don't understand the negation regex well enough to make this work. Can someone help. The ideal output will be:

as-path-set DAVE-55555-CBG
as-path-set DAVE-44444-CBG
as-path-set DAVE-33333-CBG
as-path-set DAVE-11111-CBG
as-path-set DAVE-22222-CBG
2 Answers
Related