Regex based prefix parsing