[TxMt] TM doesn't have trouble with RE, but I have.

marios tmtxpstuff at consking.com
Wed Feb 20 16:58:50 UTC 2008


Hi there.

I'm twiddling here around with a RE problem and was wondering if you
could help me.

So here is the case. I want do do some tricky Syntax highlight matching,
and wanted to have the visual sidebar with the line numbers.

So in order to test this, I do inside TM Document window this:

(^[^\n]*\n)

This seems to work fine, and will select every single line in document
window.

But is I test the Javascript, which is:

 linenum: {
        exp: /(^[^\n]*\n)/,
        replacement: "<span class=\"$0\">    1</span>$1\n"


    },

It doesn't do the replacement. So I also added a line-break in the
replacement-string, after the capture register, as you can see above,
but no honey.

As you can see, I want to replace every single in the document, with the
span instance above plus the Capture Register( Just like the Ruby code
does in TM Bundle ), which is the whole line, whether it is empty or not.

Any Ideas ?

regards, marios



More information about the textmate mailing list