homechevron_rightProfessionalchevron_rightComputers

Split list items according to regular expression

This online calculator splits list items according to the result of matching the regular expression. Matched value becomes a group key, list items with the same matched value create a separate group.

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.

PLANETCALC, Split list items according to regular expression

Split list items according to regular expression

Groups
 

Creative Commons Attribution/Share-Alike License 3.0 (Unported) PLANETCALC, Split list items according to regular expression

Comments