The string that i have is
[<span class="link" nr="28202" onclick="javascript:openAnlaggning('/kund/Bridge/Main.nsf/AnlOkatSamtligaFaltCopy/045C9DDFDC7AB308C1257C1B002E11F1?OpenDocument&urval=1');" >Alingsås Järnvägsstation</span>]
The logic is to check if there is a '[' at the start of the string and if it is present then take the value between the square brackets. In the above string what i would like to get as output is
<span class="link" nr="28202" onclick="javascript:openAnlaggning('/kund/Bridge/Main.nsf/AnlOkatSamtligaFaltCopy/045C9DDFDC7AB308C1257C1B002E11F1?OpenDocument&urval=1');" >Alingsås Järnvägsstation</span>
I tried with this
var out = value.match('/\[(.*)\]/i');

I tried it on scriptular.com,and i do get a match.
Thanks in advance.
value.charAt(0)will solve further problems with IE.substr()doesn't work in the way I had hoped =(slicedoes that trick;)]is present, See my answer.