I am trying to get some data for Splunk.
From this:
this my line - Fine (R/S)
more date - I like this (not)
date - output (yes)
I like to get all data from -
to the end of line, but not the data in parentheses if it contains not
or yes
, so data in group1
should be:
Fine (R/S)
I like this
output
I have tried some like this:
- (.+) (?!(not|yes))
But this gives:
Fine
I like this
output
Or This:
- (.+)(?!not)
Gives:
Fine (R/S)
I like this (not)
output (yes)
You may try this,
DEMO
or
This would capture all the chars until a
space(yes)
orspace(no)
or end of the line is reached.DEMO