capitaomorte/yasnippet — Issue #200: string-match does work strangely inside the snippet
Author: gabrielelanaro
Created: 2011-12-01 22:07:54+00:00
State: open

Using this snippet:

def $1(self${2:}):
super($3,self).$1(${2:$(if (string-match ", *\\(.*\\)" text) (match-string 1 text) text)})
$0

the string-match expression never matches. I think I've found the reason:

substituting ```", *\\(.*\\)"``` with ```", *\\\\(.*\\\\)"``` seems to solve the problem. Why I need to tetra-escape?