Regular expression, help needed
Jay Kickliter
Posts: 446
I'm working on a Textmate bulde for the Prop, using bstc and bstl for compiling and loading. But I really suck at regular expressions. I'm chasing my tail on this bit here:
I can't figure out how to capture 0 to n local variables after the `|' in a method declaration, then there's the return variable also. Any suggestions?
Thanks.
{ name = 'meta.method.spin'; match = '^(?i)(pub|pri)\s*(\w+)\s*\|*\s*(\w+, )*'; captures = { 1 = { name = 'keyword.other.declaration.spin'; }; 2 = { name = 'entity.name.function.spin'; }; 3 = { name = 'storage.variable.local.spin'; }; }; },
I can't figure out how to capture 0 to n local variables after the `|' in a method declaration, then there's the return variable also. Any suggestions?
Thanks.
Comments
What is your final objective? A full parse or just enough to do highlighting?
-Phil