[TxMt] Compound regular expressions in snippets

Jordan Harper jordan.harper at cimex.com
Fri Jul 6 10:35:13 UTC 2007


I'm having a bit of trouble trying to work out if it's possible to  
have compound regular expressions in a snippet.

Basically, I want to replace all spaces in a tab-stop with hyphens,  
whilst also lowercasing the whole string -- two things I can happily  
do separately:

${1/.*/\L$0/}
${1/ /-/\g}

but can't seem to work out if it's possible to do both at the same  
time. I've tried replacing the tab-stop in one expression with the  
output from another:

${${1/ /-/\g}/.*/\L$0/}

but it doesn't work. I know it's possible if I create an intermediate  
tab-stop like this:

${2:${1/.*/\L$0/}}
${2/ /-/\g}

but I don't want to do this as I have no use for the intermediate value.

Any help would be greatly appreciated! Thanks in advance.

Jordan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20070706/29bad0f9/attachment.html>


More information about the textmate mailing list