i am trying to write a regular expression for matching any words like which come in between "$" for example var myString = " there was a $dog$# and a $rat$ in a town"; i want to match dog and rat i have written the expresion for it
var reg = /^$(.*)$/gmi
but that does not because , the "$" being special character of end of line , how can i escape it , can i use "\" ?? can you pelase suggest the correct expression .