this isn't possible with one regexp. Either use
{
onMatch : function(v) {
var tokens = v.slice(2, -1).split(/(,\s+)/).map(function(v) {
return {
value: v,
type: v[0]=="."? "keyword" : "variable"
}
})
tokens.unshift({value: "{:", type: "constant"})
tokens.push({value: "}", type: "constant"})
return tokens;
},
regex : "{:((\\.\\w+)(,\\s*|))+}"
}
or
this.$rules = {
"start" : [ {
token : "constant",
regex : "{:",
next : [{
regex: "\\.\w+",
token: "keyword"
},{
regex: ",",
token: "variable"
},{
regex: "$|}",
token : "constant",
next: "pop"
}]
}]
};
this.normalizeRules()