Regex - Extract string between square bracket tag : <p>I've tags in string like <code>[note]some text[/note]</code> where I want to extract the inside text between the tags.</p>

<p>Sample Text:</p>

<pre><code>Want to extract data [note]This is the text I want to extract[/note] 
but this is not only tag [note]Another text I want to [text:sample] 
extract[/note]. Can you do it?
</code></pre>

<p>From the given text, extract following:</p>

<p><code>This is the text I want to extract</code></p>

<p><code>Another text I want to [text:sample] extract</code></p>
