I think this is a easy task but I'm new to regex so can't figure it out. I want to filter a list that contains something like this: "ANY"-"ANY"-"ANY"
Input:
List1 = ["AB.22-01-01", "AB.33-01-44", "--4", "AA.44--05", "--"]
Output:
List2 = ["AB.22-01-01", "AB.33-01-44"]
Each item will contain two "-" but I only want to get the ones with text on each sides of the "-".
filter(lambda x: len(x.split('-')) == 3 and all(x.split('-')), List1)? - Maciek