The online calculator below splits list of strings using regular expression. Each string is tested for a match, if match is found, it becomes the group key, and string is assigned to this group. Thus you are sorting out the list to groups.
To illustrate how it works I used list of emails as default value for the list. Emails come from different domains, so this calculator splits the list by email domain. Regular expression matches email starting from @ symbol, and matched value in the form of @domain.name is used to group emails. Domain names are sorted alphabetically, then calculator lists all emails matching the same domain name in separate group for each domain.