I've been looking at making more snippets for Sublimetext2. I've been looking at http://sublimetext.info/docs/en/extensibility/snippets.html and other questions here and I was able to write this snippet to get the name of the file as a function name:
<content><![CDATA[function ${1:${TM_FILENAME/(.+)\..+|.*/$1/:name}$SELECTION()
{
}]]></content>
But now I am trying to write one that takes TM_FILEPATH does a replace and slices of the filename and the beginning of the path. For example I want to turn this:
"/Library/WebServer/Documents/projects/CGI/source/com/test/play/Bla.js"
into this:
"com.test.play"
I am stumped by the regex syntax and what I should do with "${var_name/regex/format_string/options}". Can anyone explain to me how to write such a regex, and how to use these four items to rewrite the TM_FILEPATH variable?