<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>How does this work for you:</div><div><br></div><blockquote class="webkit-indent-blockquote" style="text-align: left;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">${1:type here}<br>RESULT: ${1/(\w+)((?:_|\s)+)?/\L$1\E(?2:_)/g}<br><br>Your Code would look like:<br><li id="${1/(\w+)((?:_|\s)+)?/\L$1\E(?2:_)/g}"><a href="#">$1</a></li><div><br></div></blockquote><div><div>Breaking down the regular expression:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(\w+) = This is the first group, $1, matching a word<br></div><div> ( (?:_|\s)+ ) = This is the second group, $2, matching multiple underscores and whitespace</div><div><br></div><div>Replacing with:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>\L$1\E = Lowercase version of $1, the word<br></div><div> (?2:_) = If something was found for $2, make it a single underscore</div><div><br></div><div>This doesn't handle non-word characters like !@#$%'" etc.</div><div><br></div><div>Does this point you in the right direction?</div><div>- Joseph Pecoraro</div></div><br><div><div>On Mar 17, 2009, at 5: 12PM, Saul Rosenbaum wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Alas I wish there where more basic explanation in the docs<div>I can''t for the life of me figure it out..</div><div><br></div><div><br></div><div><br><br><div class="gmail_quote">On Sun, Mar 15, 2009 at 2:14 PM, Oliver Taylor <span dir="ltr"><<a href="mailto:olivertaylor@me.com">olivertaylor@me.com</a>></span> wrote:<br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Sat, Mar 14, 2009 at 1:55 PM, Saul Rosenbaum <<a href="mailto:saul@visualchutzpah.com">saul@visualchutzpah.com</a>> wrote:<br> <br> > what I'm trying to accomplish is (replacing the spaces with underscores and<br> > making it all lowercase)<br> > <li id="this_is_a_mixed_case_string_with_spaces"><a href="#">This is a Mixed<br> > case String with SPACES</a></li><br> <br> </div>Take a look in the TextMate documentation § 7.7 "Transformations".<br> You'll find what you're looking for there.<br> <br> _______________________________________________<br> textmate mailing list<br> <a href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a><br> <a href="http://lists.macromates.com/listinfo/textmate" target="_blank">http://lists.macromates.com/listinfo/textmate</a><br> </blockquote></div><br><br clear="all"><br> </div> <br>_______________________________________________<br>textmate mailing list<br><a href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a><br>http://lists.macromates.com/listinfo/textmate<br></blockquote></div><br></body></html>