MATLAB: Regexp Find Digit between two hyphens

regular expressions

I have a str that looks like this:
str = '7-6-1'
and I would like to return 6.
I was able to return 7 using ^[^-]*[^ -] but can't seem to find the expression to return the second item.

Best Answer

(?<=-)\d(?=-)
Is one of the ways.
(?-)\d(?-)
might work