I would tell it erases only files with a dot in their name. To remove only the directories inside /tmp, first find them:
find /tmp -mindepth 1 -type d -print0 | xargs -0 rm -rf
the option mindepth 1 excludes the /tmp directory itself. First try the find command without the option -print0 and without piping the output to xargs. If the resulting list of directories is exactly the list you want to remove, then you can safely apply the whole command.