I have string like this
var str = "#it
itA
itB
_
#et
etA
etB
_
etC
etD"
How can I retrieve elements between # and _. As of now I am splitting the text with new line but unable to workout this. Please help me on this. Please use this fiddle http://jsfiddle.net/h728C/2/
I’ve posted some solution in fidde. It uses the Regex
Strip the end and beginning.
Edit
I’ve updated the fiddle and the code. Now it strips the beginning
#and ending_.You can use either. Whichever is convenient.