A few considerations as a starting point to the convo, as I'm not entirely sure what will be the most useful to you. Just let me know which of these ideas (if any) goes in the right direction, and we can take it from there.

I am not familiar with the programming language you are using, so I don't understand the syntax you wrote. (Out of curiosity, what is the language?)

It sounds like in the second set of curly braces, you want set a variable depending on a letter typed by the user. So you think your language will let you accomplish this in a single line of code, and will let you tap into the group captures directly, without giving them a variable name?

In PHP you can tap into the captured data with \1, \2 etc within the regex itself, as in (a)\1, which would match "aa". Once you leave the regex, you can still access the captures, but through a variable. For instance, after you do this match: preg_match('(a)\1','aa',$m) you can access group 1 through $m[1]

These are the only thoughts I can share. I am sure the solution will be obvious to someone who is competent in your language. Sorry I couldn't really help.

Ragax, the syntax is described at http://sublimetext.info/docs/en/extensibility/snippets.html

Andrew, it's impressive that you solved your task (auto-completing the four words) with this limited syntax. As far as I understand, you cannot test which letter was caught. Please consult Sublime Text manual; the substitution syntax is specific for the editor and not related to regular expressions.

CSS is case-insensitive, so you may wish to add /i option at the end. I also rewrote the first alternative (which catches the initial text "Absolute Relative Fixed Static"):

Andy, regular expressions don't define the substitution syntax. It's specific for the editor that you use and not related to regular expressions. You should try to find it in the manual or ask your question at Sublime Text forum (http://www.sublimetext.com/forum/).

Andy, regular expressions don't define the substitution syntax. It's specific for the editor that you use and not related to regular expressions. You should try to find it in the manual or ask your question at Sublime Text forum (http://www.sublimetext.com/forum/).