Full credit to Wiktor Stribizew:
Imports System.Text.RegularExpressions
Public Class frmMain
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim stString As String = "M0 Apple Sauce M1 Peanut Butter M2 Porcupine M3 Quesadilla M4 Margarita"
Dim arrString() As String
arrString = Regex.Split(stString, "(?!^)(?=\bM\d+\b)")
For Each st As String In arrString
MessageBox.Show(st)
Next
End Sub
End Class
Regex explanation:
The fact that the regex string is being used in a split method means that your regex pattern's goal is to find positions in the string upon which to split.
The first segment of the regex string !?^ simply asserts that there is to be no 'match' at position 0. We do have a match at position 0, but we don't want a 0-length string in the output, so we use this stipulation. I'll breakdown the second subexpression ?=\bM\d+\b:
?= is used to say "we're looking ahead of the cursor for matches of the following pattern" - without consuming the text
\b adds that the match must occur where an alphanumeric character is beside a non-alphanumeric character (in this case, always a space and an M); this is any 'word boundary'
M is indeed the literal character match of M
\d matches any decimal digit
+ means that there may be any number of decimal digits in a row at this point (one or more decimal digits)
- The last
\b details that the digit(s) end with another word boundary
Regex.Split(s, "(?!^)(?=\bM\d+\b)").