python - SublimeText2 plugin settings: Escape Dollar sign for a regex in DocBlockr plugin's settings -
docblockr sublimetext2 lets declare custom variable type rules based on name of variable.
from readme:
"jsdocs_notation_map": [{ "regex": "tbl_?[rr]ow", // arbitrary regex test against var name "type": "tablerow" // can add own types }]
i want catch variables start $
character
example:
"jsdocs_notation_map": [{ "regex": "^[$].+", // word starts $ "type": "htmlelement" // type }]
so $header
caught above regex.
unfortunately above not work. plugin won't recognize $header
variable "htmlelement".
i have tried following regex strings:
$
- matches everything, varnames no$
inside them.\\$
\\\\$
$$
\\$$
\\\\$$
[$]
[\\$]
sidenote: editor won't let me insert odd numbers of \
.
all of them match nothing, except first matches everything.
this not regex question. regexs should work, (ex: ^[$].+
) not work because of $ character. think has plugin settings mechanism , how $ used python parsing mechanism.
sidenote: "^[.].+"
regex works expected.
any welcome
ps: if can of help, "^" in start of regex string. don't think won't work out of box, if not, please share knowledge on well.
oh hey... plugin strip leading $
or _
variable/function name , apply regex. added _foo
$foo
, foo
recognised same regex, since @ time, didn't think characters having special meaning. looks it's complete misfeature in end. looks you've spent bit of time hacking on it, sorry 'bout that.
i've added issue tracker now. in future, way attention, :)
Comments
Post a Comment