<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Feb 14, 2011, at 2:07 AM, Brandon M Fryslie wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">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/ /_/}. <div><br></div><div>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.</div></blockquote><div><br></div></div><div>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 <font class="Apple-style-span" face="Monaco">${1/ /_/g}</font>.</div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Helvetica Neue'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">-- <br>Rob McBroom<br><<a href="http://www.skurfer.com/">http://www.skurfer.com/</a>><br></span>
</div>
<br></body></html>