use regex to separate a list of serial numbers into multiple lists with matched prefix
You can do this with re.findall. Instead of iterating over each string, you can combine all the serial numbers into one string and use regex to find all the matches (this implementation assumes there are no spaces in the serial number).
import re

string_list = ['bike-001', 'bike-002', 'car/001', 'bus/for/001', 'car/002', 'bus/for/002']
string = ' '.join(string_list)
matches = re.findall(r&quot;([^0-9])&quot;, string)
numbers = re.findall(r&quot;([0-9]{3})&quot;, string)
prefixes = ''.join(c for c in matches).split()
result_dict = {}
for prefix, number in zip(prefixes, numbers):
    if prefix not in result_dict.keys():
        result_dict[prefix] = []
    result_dict[prefix].append(prefix + number)

The first re.findall searches for any string that is not a number. The second finds any succession of three numbers. The next line combines the characters in matches, and since we denoted that we separated each serial number by ' ', we can split using the same value. Then, we use the same code present in your question to populate the result dictionary.