I'm trying to run a fairly simple regular expression to clear out some home directories. For background: I'm trying to ask users on my system to clear out their unnecessary files to clear up space on their home directories, so I want to inform users with scripts such as Anaconda / Miniconda installation scripts that they can clear that out.

To generate a list of users who might need such an email, I'm trying to run a simple regular expression to list all homedirs that contain such an installation script. So my assumption would be that the follwing should suffice:

```
for d in $(ls -d /home/); do
    if $(ls $d | grep -q "(Ana|Mini)conda[23].*\.sh"); then
        echo $d;
    fi;
done;

```

But after running this, it resulted in nothing at all, sadly. After a while looking, I noticed that `grep` does not interpret regular expressions as I would expect it to. The following:

```
echo "Lorem ipsum dolor sit amet" | grep "(Lorem|Ipsum) ipsum"

```

results in no matches at all. Which would then explain why the above forloop wouldn't work either.

My question then is: is it possible to match the specified regular expression `(Ana|Mini)conda[23].*\.sh`, in the same way it matches strings in <https://regex101.com/r/yxN61p/1>? Or is there some other way to find all users who have such a file in their homedir using a simple for-loop in bash?