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. [...] 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.
Actually, it's really hard to understand what you're aiming at, here. "Just like the Ruby code does in TM Bundle"... uh, which one? What command/snippet are you referring to?
I see several ways of adding line numbers to a document (bundle name): - Create HTML From Document / Selection with Line Numbers (TextMate) - Add Line Numbers to Document / Selection (Text) - Option + Command + L will show the line numbers in the gutter...
You "want to replace every single"... what? "in the document". And I'm really perplexed by the reference to testing "the JavaScript", which AFAIK isn't what bundles are written/tested/interpreted in.
I think more clarification is required so we can understand what exactly you want to do.
~ Daniel