% SEPARATE THE FUNCTIONS
regex = [
'(?<=\n\s*)' ...
'(?<prename>' ...
'function\s+' ...
'(?:\[[^\]]*\s*=\s*)?' ...
')' ...
'(?<name>\w+)' ...
'(?<postname>.*?)' ...
'(?=\n\s*function\s+)'];
a = regexp(sprintf('\n%s\nfunction ',slurp),regex,'names');
TIA
-=>J
Thanks. I converted the regex and it works well now, though still a
little slow. It turns out there was a small bug in the one I posted
anyway.
BTW, I'm really happy with the features you've put into REGEXP. I
never understood why you wanted to reinvent the wheel but you
certainly did a good job. MATLAB is far better for it.
It'd be really great if you continued to proliferate REGEXP
throughout MATLAB and the IDE.