I have character vectors of the following format;
example='S(1).a=''A''; S(1).b=''B''; S(1).c=''C''; S(1).d=''D''; \n'
And I want to extract the parts before every ;. (Ultimately, I want to eval() the whole text.)
So I tried
expression='(?:.*?);\s?';
result=regexp(example,expression,'match');
The matches are correct for the given example. However, they include the non-capturing parts from ';\s?' outside ().
And when I tried different Outkeys such as 'tokens' and 'names', there is no result -- probably because I didn't enter token names.
How do I only capture the parts in the group (?:.*?)?
The other thing is .. a confirmation that my expression does correctly extract parts matching the pattern of minimal length would be great. If not, please advise how to do it correctly. I am new to regexp(). Thanks.