Attempts to capture a zsh parameter identifier inside a text selection—intended for use in TextMate snippets that want to do additional selection based replacements (using $TM_SELECTED_TEXT
, or other expansion variables). Currently the pattern captures for all cases in the first group.
Includes some basic unit tests checking for first capture group, for common cases with surrounding whitespace:
Bare word parameter identifiers - ex. "parameter_name1
"
Basic expansions - "$parameter_name2
"
Bracketed expansions - ex. "${parameter_name3}
"