On Feb 14, 2011, at 2:07 AM, Brandon M Fryslie wrote:

I am using the ${1/foo/bar} syntax to make a snippet.  More specifically I am mirroring/transforming a previous placeholder to replace all spaces with underscores like this: ${1/ /_/}.  

However, is this only replaces the first occurrence.  Could anyone enlighten me to the correct way to do this?  Also, is there some documentation to the 'options' parameter in the regex replacement syntax?  I couldn't seem to find any under regex or snippets on the TextMate site.

I don’t know if this works in TextMate specifically, but in many other contexts, adding a ‘g’ (for global) will indicate that all occurrences on the line should be replaced instead of just the first one. Try ${1/ /_/g}.

-- 
Rob McBroom
<http://www.skurfer.com/>