I am trying to make a snippet that takes the selected text and puts it into a tag ID. I can do it with a single word, but if the selection contains multiple words, I was to replace the spaces in the selection with hyphens before inserting as the ID. This is not working:
<content><![CDATA[
<a id="$SELECTION/\s/-/g"/>$SELECTION
]]></content>
For that matter, how would I also transform the selection to lowercase? What I am looking for is to select something like “Foo Bar” and get Foo Bar