パイプ文字を含む角括弧内のテキストを取得したい。
たとえば、次のようになります。
"ERROR|appLogger|[File|name|upload<failed on server:5645>]Execution Failed[check server address][com.package.file.upload]"
抽出したい:
"File|name|upload<failed on server:5645>"
Edit: Small correction to catch stuff like [|]
as well.
Try this:
\[(([^\]]*\|[^\]]*))\]
See it in action here.
これは正規表現です
(?<=\[).*?\|.*?\|.*?(?=\])