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.

This page exists due to the efforts of the following people:

Timur

Timur

Created: 2020-09-04 09:05:54, Last updated: 2020-11-03 14:19:40
Creative Commons Attribution/Share-Alike License 3.0 (Unported)

This content is licensed under Creative Commons Attribution/Share-Alike License 3.0 (Unported). That means you may freely redistribute or modify this content under the same license conditions and must attribute the original author by placing a hyperlink from your site to this work https://planetcalc.com/8851/. Also, please do not modify any references to the original work (if any) contained in this content.

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
 

URL copied to clipboard
PLANETCALC, Split list items according to regular expression

Comments