I tried using regular expression, but like with the one you proposed, there were two problems: either only the first line is matched, e.g., in

`File "flycheck/test/resources/checkers/ocamlcOCaml.ml", line 7, characters 4-60:
Warning 8: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
2
File "flycheck/test/resources/checkers/ocamlcOCaml.ml", line 11, characters 0-9:
Error: Unbound value undefined`

only `this pattern-matching is not exhaustive.` is reported and the rest of the warning is ignored, or (using maximal-match) all warnings are matched as a single one.

Matching the header of a warning / error is easy, but its message then consists of all lines that do not start with `File `. To be honest, I do not know how to do that using `rx` Therefore I simply split the messages at `File ` and use string functions directly to extract the information.