Using regex for expanEnv, i must have the "g" option to work as intended.