The input regex will always be valid (i.e., you do not have to handle input like ?abc or (foo or any invalid input). You may output the strings in any order you would like, but each string must appear only once (don't output any duplicates).
Input: ab*a|c[de]*, 3
Output: (empty string), c, cd, ce, aa, cde, ced, cdd, cee, aba