I have a list like:
mylist = [ "abc", "def", "-" ]
I have tried and searched a vast amount of combinations, but nothing that comes close to it, the expected result should look similar to this (a combination of strings that are combined on different positions):
[ "abc", "-abc", "abc-", "-abc-", "abcdef", "-abcdef", "abcdef-",
"-abcdef-", "abc-def", "-abc-def-", "-abc-def", "abc-def-", "defabc",
"-defabc", "defabc-", "def-abc", "-def-abc", "def-abc-" ]
UPDATE:
The example above is simplified, normally there are 2 lists. One where the regular strings are (abc, def, ...) and the other one contains the special characters (.-_, etc.), (+probably the resultList). E.g.:
regularList = [ "abc", "def", "ghi", ... ]
specialList = [ ".", "-" ,"_" , ",", ... ]
resultList = [ "abc", "def", "abc-", "-abc", "-abc-", ..., "-abc_def-", ... ]
The Strings ".", "-", "_", ... (specialList) should never be in the end-result as single strings (e.g. [ "-", ".", "abc", "def", "abcdef", ... ])
I need to combine both lists, but with the special exception (as mentioned in my original post) that the characters of the "specialList" need to be at the start, end and middle of the regular string combinations.
The end-result (as mentioned before) would normally look something like this:
resultList = [ "abc", "def", "abc-", "-abc", "-abc-", "abc_",
"_abc", "_abc_", "_abc-", "-abc_", ...,
"-abc_def-", "_abc-def_", "abc-def_", ... ]
Side Note:
Not sure if that takes too much processing power / cpu. Thats why I tried to iterate through the "specialList" step-by-step to get the first combinations (then verify it on the filesystem and iterate through the next one) as mentioned in my orig. post / comment, so I removed the "specialList" to simplify the problem in the orig. post, but then I realized that combinations like "-abc_dev-" won't be possible this way, so my original approach / post won't work as I thought anyway.