Sorry for this title, I don't know how to explain my problem in one sentence.

I'm trying to match a field in a log but I don't know if it's in the middle of the line or at the end of it.

Example with three lines:

```
B=this is a short sentence C=see you soon A=hello world
C=see you soon B=this is a short sentence A=hello world
A=hello world B=this is a short sentence C=see you soon

```

I'd like to get the value of the "C" field (see you soon).
My problem is the last line, as there is no separator at the end of the string.

This is what I tried.

This one doesn't match the last line as it's the last field:

```
C=([^=]+) \w+=

```

This one works but looks over-complicated:

```
C=([^=]+)(?: \w+=|$)

```

How would you do this?