What it does
Extract the level names INFO, WARN and ERROR from log lines; group 1 is the level.
How to use it
- Load the example or paste your log.
- Check which lines matched.
- Export the levels as a column.
Verified example
Example
Text "level=INFO ready\nlevel=WARN slow"
\blevel=(INFO|WARN|ERROR)\b Result: "level=INFO", "level=WARN"
\blevel=(INFO|WARN|ERROR)\b Result: "level=INFO", "level=WARN"
\blevel=(INFO|WARN|ERROR)\b Result: "level=INFO", "level=WARN"
\blevel=(INFO|WARN|ERROR)\b Result: "level=INFO", "level=WARN"
Counterexample
Text "level=DEBUG"
\blevel=(INFO|WARN|ERROR)\b Result: no match
\blevel=(INFO|WARN|ERROR)\b Result: no match
\blevel=(INFO|WARN|ERROR)\b Result: no match
\blevel=(INFO|WARN|ERROR)\b Result: no match
Recorded by running fixture FX-R02 on : rp.js@1 on Node v24.21.0 (V8), v24.21.0, CPython 3.14.2 (Pyodide 314.0.7), PCRE2 10.48, go1.27.1. JavaScript results come from the rp.js@1 core on Node’s V8; your browser runs the same core.
Engines
- The same pattern runs unchanged in all four engines.
Limits
- Only the levels listed in the pattern; add others explicitly (DEBUG is not included, as the counterexample shows).