This is how you can use Regular expression. Import the below namespace.
System.Text.RegularExpressions;
You can extract the string like
string output = string.Empty;
if(Regex.IsMatch("A01B01 - My Stuff", @"A01B01"))
{
output = Regex.Match("A01B01 - My Stuff", @"A01B01").Value;
}