Home Download Buy Blog Forum Support

Double replace snippet

Double replace snippet

Postby Blue112 on Wed Aug 24, 2011 2:55 pm

Hello here.
I've created a snippet for haXe :
Code: Select all
<snippet>
   <description>Class Declaration</description>
    <content><![CDATA[package ${1:${TM_FILEPATH/\/([a-z]+)/.$1/g}};

class ${TM_FILENAME/\.hx//}
{
   public function new()
   {
      $2
   }
}
]]></content>
    <tabTrigger>class</tabTrigger>
    <scope>source.haxe.2</scope>
</snippet>


It's used to create the begin of a newly creating file.
My problem is for this regex :
${1:${TM_FILEPATH/\/([a-z]+)/.$1/g}}

It outputs :
.home.blue.git.repos.src.eu.blue.web.site.package/SourceFile.hx
I'd like to have just :
eu.blue.web.site.package
(so, cut just after src. and before /)

It is possible with the use of two regexes, but it seems like I can't do that. Can I have some help on that ?

Thanks.
Blue112.
Blue112
 
Posts: 2
Joined: Wed Aug 24, 2011 2:51 pm

Re: Double replace snippet

Postby Blue112 on Thu Sep 01, 2011 11:30 am

Up.
Blue112
 
Posts: 2
Joined: Wed Aug 24, 2011 2:51 pm


Return to Technical Support

Who is online

Users browsing this forum: nonolly and 30 guests