The goal of this challenge is to reduce a list of string to a shorter more general list of string.
The Input is provided with space between the string (a b c) or in list form (["a","b", "c"]). It's a list list of string that can be of the following form :
With aaa any set of non capital alphabetic letter, and X or Y any digit between 0 and 9.
A list of generalized string that can be separated by anything. String are of the form :
With aaa any set of non capital alphabetic letter that were in the input list. X and Y stay the same and symbolise the digit. The goal of the challenge is to reduce the input list of string into their generic representation.
Two strings can be reduced :
Input : regex1 regex2 split1/0 Output : regexX splitX/Y
Full example :
Input : toto toto titi titi1 titi2 titi5 tutu tutu0 tutu1 tutu1/2 tutu0/1 Output : toto titi titiX tutu tutuX tutuX/Y
Another example :
Input: ["foo0","bar0","baz0/0","eth0/0","eth0/1","eth1/0","eth1/1","vlan8","modem0"] Output: ["fooX","barX","bazX/Y","ethX/Y","vlanX","modemX"]
This is code-golf; shortest code in bytes wins.