octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #38149] regexp doesn't return empty tokens --


From: Rik
Subject: [Octave-bug-tracker] [bug #38149] regexp doesn't return empty tokens -- they just disappear
Date: Fri, 01 Feb 2013 16:11:52 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0

Follow-up Comment #7, bug #38149 (project octave):

Thanks Michael.  I guess I don't know how to write Matlab code very well
because I was expecting that it would actually print the matrix of
tokenExtents rather than just declaring it to be a matrix.

Maybe this more explicit code will work.


te = regexp ('abc', 'abc(z?)', 'tokenExtents');
disp (te)

te = regexp ('abc', 'abc(z)?', 'tokenExtents');
disp (te)

[T, TE, NM] = regexp (sprintf('%s','John Davis\nRogers, James'),
'(?<first>\w+)\s+(?<last>\w+)|(?<last>\w+),\s+(?<first>\w+)', 'tokens',
'tokenExtents', 'names');
disp (T)
disp (TE)
disp (NM)

te = regexp ('abce', '((a)(z)?b(c)(z*))(z)?(e)?', 'tokenExtents');
disp (te)

[S, E, TE, M, T, NM, SP] = regexp ('abc',
'(?<all>(a)(?<miss1>z?)b(?<hit1>c)(z*))')

disp (TE)
disp (T)
disp (NM)




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?38149>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]