Use this regular expression which gives list of matches adjacent to MM
(?<=MM )[\W\d]+(?=MM)
or
(?<=M )[\W\d]+(?=MM)
Now you have all the values, convert them to integer and check whether the value is greater than 0, by using if condition, if the value is less than 0 break the loop and take the item.
You can test the above regex in https://regex101.com/ with the above text mentioned.
In my scenario I have made constant as MM and based on this constant I will be extracting the next part that is number and again I am taking MM as constant so it never fails,
But if you want to use your regex that’s totally fine.