I have a string that either has a number or the letter a
, possibly followed byr
or l
.
In MATLAB the following regexp returns as
>> regexp('10r', '([0-9]*|a)(l|r)*', 'match')
ans =
'10r'
I would expect 10
and r
separately, because I have two capture groups. Is there a way to get a cell array with both returned independently? I can't see it in the documentation.