Reputation: 43
I need to get strings between first pipe to third pipe.
Eg given
DOWN | Origin - test-pd-2 | Pool - test-pd | TCP timeout occurred
match:
Origin - test-pd-2 | Pool - test-pd
I tried this, but it didn't work:
.*\\|(.*)\|
Upvotes: 3
Views: 537
Reputation: 163217
Using a capture group and a negated character class, you might also use
^[^|]*\| ([^|]+\|[^|]*[^\s|])
Upvotes: 1