On 2006-07-31, at 00:12, Allan Odgaard wrote:
On 30/7/2006, at 1:13, cormullion@mac.com wrote:
Definitely! And I've got to work out how to match any number of arguments, each of which can contain any character except " ' ( ) : , and space, but mustn't start with # ; " ' ( ) { } . , 0 1 2 3 4 5 6 7 8 9. I'll have to go back to regexp school, i think. :-)
Something like: (?![#;"'(){}.,0-9])[^"'(): ]+
Thanks, Allan. Your help is appreciated - I'm finding this quite tricky! ;-)
I've got the idea of matching the names, but now I'm trying to work out how to match the shape of possible function definitions. Assuming temporarily that names are just [a-z]*, I'm trying to match:
(define (func) (define (fun arg1) (define (func arg1 arg2) (define (func arg1 arg2 arg3)
I can find these patterns with:
((define)(\s+)((\w+\s*)+())
but I can't successfully capture a variable number of arguments for use with 'capture'?
The rest of TextMate is looking very nice.... ;-)