Hi, I’m trying to use ${5:helper text} variable in my regular expression later in the code:
${5/(e)|(.*)/(?1:\te.preventDefault();\n)(?2:)/}})
What I do here? I check if $5 equals "e" and if it does, I append ".preventDefault();" to my "e". But I’d like to write something like this:
${5/($5)|(.*)/(?1:\t$5.preventDefault();\n)(?2:)/}})
Which simply means I’d like users to be able to change "e" into, for example "event".
My whole snippet, for better understanding:
bind('${1:event name}'${2:, ${3:passed object}}, function(${4:e}) { ${0:$TM_SELECTED_TEXT} ${4/(e)|(.*)/(?1:\t/$4.preventDefault();\n)(?2:)/}})