MATLAB: How to parse information between two strings using regular expressions

MATLABregular expressions

Hello,
I am trying to parse some information contained between the two strings "<sample>" and "</sample>" . I am new to regular expressions and would like to know what expression suits my requirement. The strings i mentioned have some operators in them. This is making the job difficult.
Regards, Math

Best Answer

str = '<sample>a,b,c</sample>';
out = regexp(str,'((?<=<sample>).*(?=<\/sample>))','match')
or
t = regexp(str,'<(|\/)sample>','splite')
out = t(~cellfun(@isempty,t))