I seem to match two things using extended regular expressions:
- Newline. I have tried
[ \\n], both don't work
- Negative lookahead for string "timeout". I have tried (?!timeout)
Can anyone please point out the correct way?
If you're using bash, you can write
If you're using dash (e.g., inside a shell script), you can always use a literal quoted newline:
Not elegant, but it works.
You'll have to use Perl Compatible Regular Expressions (
Oftentimes, it's sufficient to mimic negative lookaheads.
is equivalent to
If any of the above matches, the string is not timeout.