Using a PRCE Regex, I want to capture each field of different apache weblogs. The structure of these logs is like this example:
aaa bbb "cc c" ddd "eee" fff
Each field is seperated by a space. But fields may also contain spaces in which case they are held together by quotes at the beginning and the end of the field("cc c"). Fields not containing spaces my also have quotes at the beginning and the end of the field ("eee").
The result should have a capture group for each field so for the example that should be: Group1: aaa Group2: bbb Group3: "cc c" Group4: ddd Group5: "eee" Group6: fff
My problem is that I want a one-fits-all solution, e.g. witha a quantifier - something like this: (?:((aa|bb|"cc"|dd)\s){1,})
But here the quantifier always repeats at aaa .
A tidy, working solution is much appreciated.