|
From: | John W. Eaton |
Subject: | Re: Regexp cleanup |
Date: | Thu, 04 Jul 2013 09:40:42 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 |
On 07/04/2013 03:37 AM, Laurent Hoeltgen wrote:
On 07/03/2013 09:57 PM, PhilipNienhuis wrote:Rik-4 wroteThe re-write also solves the following existing bugs (I said it was creaky). 38778: wrong return value for regexp 38616: memory leak 38149: wrong tokens returned
Thanks!
So, depending on what Matlab does, would it be okay to drop support for this esoterica? I'm pretty tired of trying to work it out at this point. --RikMatlab r2013b prerelease does (after changing double quote to single quote, and removing empty lines):[S, E, TE, M, T, NM, SP] = regexp ('John Davis\nRogers, James', '(?<first>\w+)\s+(?<last>\w+)|(?<last>\w+),\s+(?<first>\w+)')S = 1 12 E = 10 25 TE = [2x2 double] [2x2 double] M = 'John Davis' 'nRogers, James' T = {1x2 cell} {1x2 cell} NM = 1x2 struct array with fields: first last SP = '' '\' '' ...so it seems Matlab thinks this is valid.
Matlab R2012a returns the same result as above.
Rik, I'm pretty sure this complexity was added to Octave for Matlab compatibility reasons.
jwe
[Prev in Thread] | Current Thread | [Next in Thread] |