in reply to Check if dir exist using regexp

You can't use a regex in that context. If the name has the literal "_Dir_Name" at the end you can disambiguate the $version from the "_Dir_Name" like this.

if ( -d "$stream.${version}_Dir_Name" ) { ... }

If you have more than one possible directory that you are trying to match then you could look at opendir / readdir or, perhaps, glob and filter out what you want with grep.

I hope this is of use.

Cheers,

JohnGG