Thanks for the help. If you'll indulge me one more tiime:
So now I have written: { name = 'element.comment.first'; match = '[*][^*]*[*]'; },
If the line reads *;lk;lk* it captures what's between the asterisks. If the line reads *lkjsdflkjs* hello there *sjlfskjd*, it will capture both elements between the asterisks. BUT if the line is: Hello there *lskjdflsjdfsl* I want to go, it doesn't capture what is between the asterisks.
Any more suggestions?
Thanks.
On 8/18/06, Ed Singleton singletoned@gmail.com wrote:
On 8/18/06, Allan Odgaard throw-away-1@macromates.com wrote:
On 17/8/2006, at 22:04, Lawrence Goodman wrote:
[...] For example if I type:
- Textmate *
This would be identified as element.comment.first.
So I wrote the following [...]
match = '[*]\s?([^\* ]|\.| [*] | )*[*]';
That is a somewhat puzzling pattern. It matches *, optional whitespace, a sequence of 'not * or space' or the '.' character, or the ' * ' sequence. And then finally a '*'.
The second branch is redundant and the third I think is unwanted.
The problem is it can't identify the element when it comes in the middle or end of a line, i.e. I want to learn how to use * Textmate * tomorrow.
What it can't identify is when the terminating '*' has spaces on both sides, as it will then be taken by your middle repeat, and the terminating state is never met.
Any suggestions or help would be much appreciated. Thanks.
Well, not entirely sure what you want to match, but sounds like just:
[*].*?[*]
That matches from asterisk to asterisk.
Or
[*][^*]*[*]
Which looks even prettier (though the ^ does spoil it a little)
Ed
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate