Yes, that was it. Nearly perfect for me. Just got to remove the uppercase letter. Would that be something like :
${1/\\w+{(.*?)}|\(.)|(\w+)|(\W+)/(?4:_:\L$1\L$2\L$3)/g}
?
Can I suggest to think about including this in every section/ subsection/paragraph snippet of the LaTeX bundle? Well, if it's behaviour match other users expectation, of course.
Édouard
Le 2 juin 07 à 05:21, Allan Odgaard a écrit :
On 1. Jun 2007, at 02:34, Édouard Gilbert wrote:
While I'm at it, is there also a way to escape some commands in the same time ?
Typically, when I type
\lastname{Kant}'s life as a title, I'd like it to b converted to kant_s_life
But when I type \Z is the integer set (\where \Z is a macro to type Z in mathbf)
I'd rather like z_is_the_integer_set
Does anyone have an idea of some way to achieve that? I guess the first part should be too hard, but I'm far from being an expert in regexp.
Not entirely sure of the context -- this is a snippet regexp transformation?
Presumably something like this will do:
${1:your text} → ${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|(\W+)/(?4:_:$1
$2$3)/g}
Here we match: a command of the form \command{«value»} or an escaped character of the form \«char» or multiple word characters or multiple non-word characters
If the last branch is taken, we insert an underscore, otherwise we insert the result of the other captures (we insert all 3, but since this is an OR, only one will actually have a value).
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate