Log Level
beginnerMatches common log level indicators (DEBUG, INFO, WARN, ERROR, FATAL).
loglevelseverityfiltering
Pattern
/\b(?:DEBUG|TRACE|INFO|WARN(?:ING)?|ERROR|FATAL|CRITICAL)\b/giTry It
0 of 7 strings matched
Explanation
Matches standard log severity levels as whole words. Handles both WARN and WARNING variants. Case-insensitive.
Test Strings
Matching
- ERROR: something failed
- [INFO] Starting server
- WARN: deprecated API
- CRITICAL failure
Non-matching
- information
- no level here
- DEBUGGER
Language Compatibility
| Language | Support |
|---|---|
| JS | Full support |
| PYTHON | Full support |
| JAVA | Full support |
| PHP | Full support |
| GO | Limited support (ASCII-only word boundaries) |
Code Snippets
const regex = /\b(?:DEBUG|TRACE|INFO|WARN(?:ING)?|ERROR|FATAL|CRITICAL)\b/gi;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);