<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Jan 22, 2006, at 2:37 PM, Gary L. Gray wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><SPAN class="Apple-tab-span" style="white-space:pre">  </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN>s/(?<=\\|sub)sub/ /g; <SPAN class="Apple-converted-space">            </SPAN># replace all leading "sub" with an em-space</FONT></P> </BLOCKQUOTE></DIV><DIV><BR class="khtml-block-placeholder"></DIV>Try to replace the s in the first sub with (s|S)<DIV>This tells the regexp engine to match either an s or an S at that point.</DIV><DIV>Have a look at this document for more on regular expressions used in textmate:</DIV><DIV><A href="http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt">http://www.geocities.jp/kosako3/oniguruma/doc/RE.txt</A></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Then you also need to change the latex syntax to recognize your (sub)sections as having scope meta.section.latex</DIV><DIV>In particular, in the LaTeX language file, you will find the line:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>begin = '((\\(?:(?:sub)*section|chapter|paragraph|part))(\*?)(?:(\[)[^\[]*?(\]))??(\{))';</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>near the top.If you change the first "s" there to (s|S) instead, that might do it (haven't tested it).</DIV><DIV>This will also be matching stuff like \SubSubsection, I hope that's alright.</DIV><DIV><BR><DIV> <DIV>Haris</DIV><DIV><BR class="khtml-block-placeholder"></DIV> </DIV><BR></DIV></BODY></HTML>