私はテスト文字列を持っています:ネストされたタグの一致した出現数
s = "A test [[you|n|note|content of the note with a [[link|n|link|http://link]] inside]] paragraph. wef [[you|n|note|content of the note with a [[link|n|link|http://link]] inside]] test"
です。
文字列の[[...]]
部分の出現と一致する必要があります。文字列中にネストされた[[ ]]
タグの第2レベルまでが可能です(テスト文字列に示されています)。
私は/\[\[.*?\]\]/
を始め、それは唯一の次に一致します。 [[you|n|note|content of the note with a [[link|n|link|http://link]]
(それは]]
の最後の発生を欠けている
私は、各[[ .. ]]
ブロックの残りの部分に一致する行くにはどうすればよいの正規表現でこれは可能ですか? ?
外側のもののみが必要ですか?内部に単一の '['または ']'がありますか? – sawa
あなたの例として望ましい結果は何ですか? –