Here is a script that will do what you want, given the example you gave. If you have a lot more pin combinations that require exception processing this may not be the best way to handle this.
Names Default To Here( 1 );
dt = Current Data Table();
dt << New Column( "Generated Pin Group", character );
For Each Row(
// Get the first part of the group name
First = Lowercase( Substr( :Pin, 1, 4 ) );
// Handle exceptions like the below case
If( First == "ddrr",
First = "ddr0"
);
// Now attach the "_"
First = First || "_";
// Now add the second part based upon the given complexities
// Handle the clk
If(
Contains( :Pin, "_CK" ) > 0 & Contains( :Pin, "_CKE" ) == 0, First = First || "clk",
// Handle the vref
Contains( :Pin, "_VREF" ) > 0, First = First || "vref",
// Handle the cke
Contains( :Pin, "_CKE" ) > 0, First = First || "cke",
// Handle the reset
Contains( :Pin, "RESET" ) > 0, First = First || "Reset"
);
:Generated Pin Group = First;
);
If you want to do this as a formula for a column, it is just a simple change
First = Lowercase( Substr( :Pin, 1, 4 ) );
If( First == "ddrr",
First = "ddr0"
);
First = First || "_";
If(
Contains( :Pin, "_CK" ) > 0 & Contains( :Pin, "_CKE" ) == 0,
First = First || "clk",
Contains( :Pin, "_VREF" ) > 0, First = First || "vref",
Contains( :Pin, "_CKE" ) > 0, First = First || "cke",
Contains( :Pin, "RESET" ) > 0, First = First || "Reset"
);
First;
Jim