(?i) matches only word beginning?

A log entry containing the word AttributeError matches |~ "(Error)", but for some reason does not match |~ "(?i)(Error)". Seems like (?i) makes it only match from the word beginning, while it shouldn’t. What am I missing? Or is this a bug?

Strangely, even |~ "(?i)(.*error.*)" does not match.

I just tried and I don’t see this behavior. What version of Loki are you using? Can you provide example query and logs, and screenshots please?

Oh, right - likely a very old version. This works correctly in Grafana Cloud. Sorry for the noise. :slight_smile: