Using the string
A B x C x D - E x F
I am trying to capture the groups A B C and D but not E or F.
My understanding of regex is that I want everything before \sx\s up to the \s-\s,
so I would start with .*(?=\sx\s),
which I want to happen as many times until I reach the \s-\s.
My result is (.*(?=\sx\s))*.*(?=\s-\s) which returns A B x C x D.
I think this may have to do with the way lookaheads work but I am lost on what to change.