How do I match a pair of double pipes (i.e. || text ||
), while checking the content between the pipes for a singular pipe?
So, || text ||
matches " text "
, while || spoiler2|spoiler||
matches " spoiler2|spoiler"
.
I've tried \|\|([^\|]+)\|\|
, but that only matches the content without any further pipes between the two pipes.