[TxMt] Nested Transformations in Snippets

Ed Singleton singletoned at gmail.com
Wed Apr 4 10:45:03 UTC 2007


On 4/4/07, Allan Odgaard <throw-away-1 at macromates.com> wrote:
> On 4. Apr 2007, at 10:49, Ed Singleton wrote:
>
> > On 4/3/07, Allan Odgaard <throw-away-1 at macromates.com> wrote:
> >> On 3. Apr 2007, at 17:05, Ed Singleton wrote:
> >> > [...]
> >> > Which is good enough as a solution, but I'd still like to know if
> >> > there is a way to solve the problem using nested regexs?
> >>
> >> Nested regexps are currently not supported.
> > Fair enough.  Is that 'currently' as in 'it's on the todo list' or as
> > in 'it's not considered a particularly important feature'?
>
> There will be "nesting" in 2.0, that is re-applying a regexp on a
> capture variable.
>
> For example you can do:
>
>     ${1/(.*)Form/${1/…/…/}Field/}
>
> Here the inner substitution on capture 1 would do the CamelCase to
> underscore_case or vice versa.
>
> But chaining regexp substitutions, as what you really asked for, that
> is not presently planned mainly because I don't like the syntax I
> have been able to come up with for it, and the usefulness is even
> less when nesting is introduced.

That looks like a perfectly fine system.  I get more excited about
version 2.0 every time I hear about it.

Ed


More information about the textmate mailing list