I'm passing a list of dir/subdirs into a playbook as follows:
dirs=['Web\this','Web\that','Web']
This works fine when I actually do tasks on those directories (win_shell, invoking a build process), but later I need to copy the files and the '\' does not work when used as part of a filename. I'm interested in using the following, so I'll get the module name for most builds and 'Web' for the one that is in the root folder:
dirs[1].split('\\')[-1]
I hoped this would return 'this', 'that', and 'Web', respectively.
But I can't find any combination of slashes or regex magic to split my strings. I've found about 5 questions/answers in StackExchange that are close, but none of them seem to do it.
I've also tried this with variations of
"{{ dirs[1] | regex_replace('\\','-') }}"