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:
.*\\|(.*)\|
Using a capture group and a negated character class, you might also use
^[^|]*\| ([^|]+\|[^|]*[^\s|])
Regex demo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With