/ruby-mode/Strings/gsub(;..;) { |match| .. } (gsu).yasnippet
http://github.com/ridgetang/snippets · Unknown · 6 lines · 6 code · 0 blank · 0 comment · 0 complexity · 6d5a728380bb46fb327401995c3c08b0 MD5 · raw file
- # -*- mode: snippet -*-
- # key: gsu
- # contributor: Translated from TextMate Snippet
- # name: gsub(/../) { |match| .. }
- # --
- gsub(/${1:pattern}/) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:match}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 }